com.ibm.able.platform
Class RmiAbleEServerJobServiceProxy

java.lang.Object
  |
  +--com.ibm.able.platform.RmiAbleEServerJobServiceProxy
All Implemented Interfaces:
AbleEServerJobService, AblePlatformService, AblePlatformServiceEventGenerator, java.io.Serializable, javax.agent.service.Service

public class RmiAbleEServerJobServiceProxy
extends java.lang.Object
implements AbleEServerJobService, java.io.Serializable

An RMI Job Service proxy contains a reference to an RMI version of a Job Service. The proxy contains methods identical to the methods in the actual service. When a method is called on the proxy, the proxy forwards the call on to the actual service. However, the proxy (1) traps all RemoteExceptions that might be thrown by the service, (2) turns the RemoteExceptions into AbleEServerJobExceptions, and then (3) rethrows the new exception. In this way, code making use of the proxy does not have to be sensitive to RMI RemoteExceptions and can code to a common Agent Life Cycle Service interface.

See Also:
Serialized Form

Fields inherited from interface com.ibm.able.platform.AbleEServerJobService
COLUMN_NAMES, COLUMN_TYPES, SERVICE_PATH, SERVICE_TYPE
 
Constructor Summary
RmiAbleEServerJobServiceProxy(RmiAbleEServerJobService theDelegate, java.rmi.registry.Registry theRegistry, java.lang.String theAddress)
          Create a proxy over the specified RMI reference to an Able EServer Job Service.
 
Method Summary
 void addAblePlatformServiceEventListener(AblePlatformServiceEventListener theListener)
          Adds a service event listener to this service.
static java.lang.String Copyright()
          Determine the copyright of this class.
 void deregisterJob(AbleEServerJobIfc job, AbleSecureKey key)
          This is the method that is used to deregister a job from the Job Service.
 java.util.Vector getAblePlatformServiceEventListeners()
          Gets a collection of all service event listeners registered with this service event generator.
 AbleEServerJobIfc getJobInfo(java.lang.String theJobKey)
          Returns the AbleEServerJobIfc that is registered to job key theJobKey.
 javax.agent.service.ServiceProperties getServiceProperties()
          Retrieve the service properties of the underlying service.
 int getState()
          Returns the state of this service.
 void registerJob(AbleEServerJobIfc job, AbleSecureKey key)
          This is the method that is used to register a job to the Job Service.
 void removeAblePlatformServiceEventListener(AblePlatformServiceEventListener theListener)
          Removes a service event listener from this service.
 void setServiceProperties(javax.agent.service.ServiceProperties theServiceProperties)
          Set the service properties of the underlying service.
 void terminateService(AbleSecureKey theSecureKey)
          Terminates this service in a controlled way; the service is removed from the service root and, if necessary, unbound from the RMI registry and unexported as a remote RMI object.
 java.lang.String toString()
          Returns a String representation of this RmiAbleEServerJobServiceProxy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RmiAbleEServerJobServiceProxy

public RmiAbleEServerJobServiceProxy(RmiAbleEServerJobService theDelegate,
                                     java.rmi.registry.Registry theRegistry,
                                     java.lang.String theAddress)
Create a proxy over the specified RMI reference to an Able EServer Job Service.
Parameters:
theDelegate - A reference to an RMI version of an Able EServer Job Service.

theRegistry - The RMI registry at which the above Able EServer Job Service is registered.

theAddress - The RMI address at which the above Able EServer Job Service is registered.

Method Detail

getServiceProperties

public javax.agent.service.ServiceProperties getServiceProperties()
Retrieve the service properties of the underlying service.

Note: In this implementation, the method call is not forwarded on to the service; null is always returned.

Specified by:
getServiceProperties in interface javax.agent.service.Service
Returns:
null at all times.

setServiceProperties

public void setServiceProperties(javax.agent.service.ServiceProperties theServiceProperties)
Set the service properties of the underlying service.

Note: In this implementation, the method call is not forwarded on to the service; the call is simply ignored.

Specified by:
setServiceProperties in interface javax.agent.service.Service
Parameters:
theServiceProperties - The service properties to be used by the service.


addAblePlatformServiceEventListener

public void addAblePlatformServiceEventListener(AblePlatformServiceEventListener theListener)
                                         throws com.ibm.able.AbleException
Description copied from interface: AblePlatformServiceEventGenerator
Adds a service event listener to this service.
Specified by:
addAblePlatformServiceEventListener in interface AblePlatformServiceEventGenerator
Following copied from interface: com.ibm.able.platform.AblePlatformServiceEventGenerator
Parameters:
theListener - Any object interested in listening for service events generated by this service.

Throws:
AbleException -

If the listener to be added is null.

On any error.


removeAblePlatformServiceEventListener

public void removeAblePlatformServiceEventListener(AblePlatformServiceEventListener theListener)
                                            throws com.ibm.able.AbleException
Description copied from interface: AblePlatformServiceEventGenerator
Removes a service event listener from this service.
Specified by:
removeAblePlatformServiceEventListener in interface AblePlatformServiceEventGenerator
Following copied from interface: com.ibm.able.platform.AblePlatformServiceEventGenerator
Parameters:
theListener - A previously registered object that is no longer interested in listening for service events generated by this service.

Throws:
AbleException -

If the listener to be removed is null.

On any error.


getAblePlatformServiceEventListeners

public java.util.Vector getAblePlatformServiceEventListeners()
                                                      throws com.ibm.able.AbleException
Description copied from interface: AblePlatformServiceEventGenerator
Gets a collection of all service event listeners registered with this service event generator.
Specified by:
getAblePlatformServiceEventListeners in interface AblePlatformServiceEventGenerator
Following copied from interface: com.ibm.able.platform.AblePlatformServiceEventGenerator
Returns:
All registered AblePlatformServiceEventListener objects.
Throws:
AbleException - On any error.

terminateService

public void terminateService(AbleSecureKey theSecureKey)
                      throws com.ibm.able.AbleException,
                             javax.agent.service.naming.NamingException
Description copied from interface: AblePlatformService
Terminates this service in a controlled way; the service is removed from the service root and, if necessary, unbound from the RMI registry and unexported as a remote RMI object.
Specified by:
terminateService in interface AblePlatformService
Following copied from interface: com.ibm.able.platform.AblePlatformService
Parameters:
theSecureKey - When security if off, this may be null as the parameter is ignored; when security is on the security key must be from an object with equal or greater authority in order for the operation to proceed.

Throws:
AbleException - On any remote error or Able error.
javax.agent.service.naming.NamingException - On any naming error.

getState

public int getState()
             throws com.ibm.able.AbleException
Description copied from interface: AblePlatformService
Returns the state of this service.
Specified by:
getState in interface AblePlatformService
Following copied from interface: com.ibm.able.platform.AblePlatformService
Returns:
The state of this service.
Throws:
AbleException - On any remote error or Able error.

registerJob

public void registerJob(AbleEServerJobIfc job,
                        AbleSecureKey key)
                 throws AbleEServerJobException
Description copied from interface: AbleEServerJobService
This is the method that is used to register a job to the Job Service.

Specified by:
registerJob in interface AbleEServerJobService
Following copied from interface: com.ibm.able.platform.AbleEServerJobService
Parameters:
job - The AbleEServerJobIfc job that is to be registered.

key - AbleSecureKey to secure communication

Throws:
AbleEServerJobException -

If the caller is not authenticated.

If attempting to register an invalid AbleEServerJobIfc Object.

If there is an existing job registered to the job key of job.


deregisterJob

public void deregisterJob(AbleEServerJobIfc job,
                          AbleSecureKey key)
                   throws AbleEServerJobException
Description copied from interface: AbleEServerJobService
This is the method that is used to deregister a job from the Job Service.

If the platform is running secure, the caller must have an authority level equal to or greater than the one who originally registered the job that is to be reomoved.

Calls to this method may be delegated, but the VerifiableAgentName at every hop along the way must be authenticated and authorized.

Specified by:
deregisterJob in interface AbleEServerJobService
Following copied from interface: com.ibm.able.platform.AbleEServerJobService
Parameters:
job - The AbleEServerJobIfc job that is to be deregistered.

key - AbleSecureKey to secure communication

Throws:
AbleEServerJobException -

If the caller is not authenticated.

If attempting to deregister an invalid AbleEServerJobIfc Object.

If there is not an existing job registered to the job key of job.

If the caller is not authorized.


getJobInfo

public AbleEServerJobIfc getJobInfo(java.lang.String theJobKey)
                             throws AbleEServerJobException
Returns the AbleEServerJobIfc that is registered to job key theJobKey.

Specified by:
getJobInfo in interface AbleEServerJobService
Parameters:
theJobKey - The job key of the AbleEServerJobIfc that is to be returned.

Returns:
AbleEServerJobIfc object registered to job key theJobKey.

Throws:
AbleEServerJobException -  

toString

public java.lang.String toString()
Returns a String representation of this RmiAbleEServerJobServiceProxy.

Overrides:
toString in class java.lang.Object
Returns:
String The String representation of this RmiAbleEServerJobServiceProxy

Copyright

public static java.lang.String Copyright()
Determine the copyright of this class.
Returns:
A String containing this class's copyright statement.