ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.able.platform
Class AblePlatformSupportImpl

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--com.ibm.able.platform.AblePlatformSupportImpl
All Implemented Interfaces:
AblePlatformSupport, java.rmi.Remote, java.io.Serializable

public final class AblePlatformSupportImpl
extends java.rmi.server.UnicastRemoteObject
implements AblePlatformSupport, java.io.Serializable

This class provides constants for ABLE platform code; provides access to "internalized" preferences regarding the platform; provides class methods to obtain the JAS Service Root; provides methods to obtain instances of this same class running in other agent pools; and the class itself, when instantiated as an object, can act as a helper to other instances of itself running elsewhere. For example, it might act as a catcher to receive "moved" agents.

Note that a given system can run one and only one instance of this class in any agent pool. If multiple agent pools are running this class, each instance must be on a different port.

See Also:
Serialized Form

Fields inherited from class java.rmi.server.RemoteObject
ref
 
Method Summary
static java.lang.String Copyright()
          Gets the copyright statement of this class.
static AblePlatformSupport getAblePlatformSupportOn(java.lang.String theHostName, java.lang.String thePort)
          Gets an AblePlatformSupport object from the specified host.
 java.lang.Object getNewObject(java.lang.String theClassName, AbleSecureKey theSecureKey)
          Gets a reference to a new instance of the specified class, which is created by calling the class's null argument constructor.
 java.lang.Object getNewObject(java.lang.String theClassName, java.lang.Object[] theConstructorArgs, AbleSecureKey theSecureKey)
          Gets a reference to a new instance of the specified class, which is created by calling the class's constructor that matches the specified arguments.
 java.lang.Object getNewObject(java.lang.String theHostName, java.lang.String thePort, java.lang.String theClassName, java.lang.Object[] theConstructorArgs, AbleSecureKey theSecureKey)
          Gets a reference to a new instance of the specified class, which is created in an agent pool on the specified host and port by calling the class's constructor that matches the specified arguments.
static java.lang.Object getObjectOn(java.lang.String theHostName, java.lang.String thePort, java.lang.String theObjectName, java.lang.Object[] theConstructorArgs, AbleSecureKey theSecureKey)
          Gets a reference to a newly created from the specified host.
 java.util.Hashtable getPlatformAgentPools()
          Gets a collection of agent pool definitions as specified in the platform preference file.
 java.lang.String getPlatformCryptographyAlgorithm()
          Gets the platform's cryptography algorithm as specified in the platform preference file.
 java.lang.String getPlatformCryptographyProvider()
          Gets the platform's cryptography provider as specified in the platform preference file.
 java.lang.String getPlatformName()
          Gets the platform's name as specified in the platform preference file.
 boolean getPlatformSecurity()
          Gets the overall ABLE security setting as specified in the ABLE preference file.
 javax.agent.service.Service getPlatformService(java.lang.String theRequestorsPort, java.lang.String theServiceAlias)
          Gets the specified platform Service object.
 javax.agent.service.ServiceRoot getPlatformServiceRoot(java.lang.String theRequestorsPort)
          Gets the platform's service root.
static void main(java.lang.String[] theArgs)
          Creates an AblePlatformSupport object.
 void terminatePlatformSupport(AbleSecureKey theSecureKey)
          Terminates this AblePlatformSupport object and the agent pool in which it is running.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getAblePlatformSupportOn

public static AblePlatformSupport getAblePlatformSupportOn(java.lang.String theHostName,
                                                           java.lang.String thePort)
                                                    throws java.rmi.RemoteException
Gets an AblePlatformSupport object from the specified host.
Parameters:
theHostName - A string representing the name of a host where an AblePLatformSupport object has been registered.

Returns:
An AblePlatformSupport object from the host.
Throws:
java.rmi.RemoteException - On any error.

getObjectOn

public static java.lang.Object getObjectOn(java.lang.String theHostName,
                                           java.lang.String thePort,
                                           java.lang.String theObjectName,
                                           java.lang.Object[] theConstructorArgs,
                                           AbleSecureKey theSecureKey)
                                    throws java.rmi.RemoteException,
                                           javax.agent.service.naming.NamingException
Gets a reference to a newly created from the specified host.
Parameters:
theHostName - A string representing the simple name of a host system; for example, "BinfordRemoteHost99".

theObjectName - The fully qualified class name of the Java object to create at the above location; for example, "com.binford.ToolUpdater". The class must be accessible through the CLASSPATH at the specified host.

theConstructorArgs - A list of arguments to be passed to the constructor of the new object. If the object's constructor takes no arguments, this parameter must be null.

theSecureKey - The secure key must include the arguments <theObjectName&rt; and <theConstructorArgs&rt;, but not/b> <theHostName&rt; and not <thePort&rt;.

Returns:
An Object which must be cast to an appropriate RMI interface.
Throws:
java.rmi.RemoteException - On any error.

getNewObject

public java.lang.Object getNewObject(java.lang.String theClassName,
                                     AbleSecureKey theSecureKey)
                              throws java.rmi.RemoteException,
                                     javax.agent.service.naming.NamingException
Description copied from interface: AblePlatformSupport
Gets a reference to a new instance of the specified class, which is created by calling the class's null argument constructor.
Specified by:
getNewObject in interface AblePlatformSupport
Following copied from interface: com.ibm.able.platform.AblePlatformSupport
Parameters:
theClassName - The fully qualified class name of the object to be created. The class name must represent a legitimate Remote, Serializable object accessible via the CLASSPATH.

theSecureKey - When platform security is off, this parameter may be null; otherwise, this must be a valid security key from a caller with the proper authority to create new objects within the ABLE platform.

Returns:
A reference to the newly constructed object. Obviously, the caller is responsible for casting the returned object to the appropriate data type.
Throws:
java.rmi.RemoteException - On any error.

getNewObject

public java.lang.Object getNewObject(java.lang.String theClassName,
                                     java.lang.Object[] theConstructorArgs,
                                     AbleSecureKey theSecureKey)
                              throws java.rmi.RemoteException,
                                     javax.agent.service.naming.NamingException
Description copied from interface: AblePlatformSupport
Gets a reference to a new instance of the specified class, which is created by calling the class's constructor that matches the specified arguments.
Specified by:
getNewObject in interface AblePlatformSupport
Following copied from interface: com.ibm.able.platform.AblePlatformSupport
Parameters:
theClassName - The fully qualified class name of the object to be created. The class name must represent a legitimate Remote, Serializable object accessible via the CLASSPATH.

theConstructorArgs - An array of objects that will be passed to the constructor of the specified class. The order and data type of each object in the array must match the signature of a constructor of the specified class.

theSecureKey - When platform security is off, this parameter may be null; otherwise, this must be a valid security key from a caller with the proper authority to create new objects within the ABLE platform.

Returns:
A reference to the newly constructed object. Obviously, the caller is responsible for casting the returned object to the appropriate data type.
Throws:
java.rmi.RemoteException - On any error.

getNewObject

public java.lang.Object getNewObject(java.lang.String theHostName,
                                     java.lang.String thePort,
                                     java.lang.String theClassName,
                                     java.lang.Object[] theConstructorArgs,
                                     AbleSecureKey theSecureKey)
                              throws java.rmi.RemoteException,
                                     javax.agent.service.naming.NamingException
Description copied from interface: AblePlatformSupport
Gets a reference to a new instance of the specified class, which is created in an agent pool on the specified host and port by calling the class's constructor that matches the specified arguments.
Specified by:
getNewObject in interface AblePlatformSupport
Following copied from interface: com.ibm.able.platform.AblePlatformSupport
Parameters:
theHostName - The IP address (name or number) of a system that is running another AblePlatformSupport object in an agent pool listening at the specified port.

thePort - The port number at which the above system is listening for remote AblePlatformSupport requests.

theClassName - The fully qualified class name of the desired object. The class name must represent a legitimate Remote, Serializable object accessible via the CLASSPATH.

theConstructorArgs - An array of objects that will be passed to the constructor of the specified class. The order and data type of each object in the array must match the signature of a constructor of the specified class.

theSecureKey - When platform security is off, this parameter may be null; otherwise, this must be a valid security key from a caller with the proper authority to create new objects within the ABLE platform.

Returns:
A reference to the newly constructed object. Obviously, the caller is responsible for casting the returned object to the appropriate data type.
Throws:
java.rmi.RemoteException - On any error.

getPlatformCryptographyAlgorithm

public java.lang.String getPlatformCryptographyAlgorithm()
                                                  throws java.rmi.RemoteException
Description copied from interface: AblePlatformSupport
Gets the platform's cryptography algorithm as specified in the platform preference file.
Specified by:
getPlatformCryptographyAlgorithm in interface AblePlatformSupport
Following copied from interface: com.ibm.able.platform.AblePlatformSupport
Returns:
The platform's cryptography algorithm.
Throws:
java.rmi.RemoteException - On any error.

getPlatformCryptographyProvider

public java.lang.String getPlatformCryptographyProvider()
                                                 throws java.rmi.RemoteException
Description copied from interface: AblePlatformSupport
Gets the platform's cryptography provider as specified in the platform preference file.
Specified by:
getPlatformCryptographyProvider in interface AblePlatformSupport
Following copied from interface: com.ibm.able.platform.AblePlatformSupport
Returns:
The platform's cryptography provider.
Throws:
java.rmi.RemoteException - On any error.

getPlatformName

public java.lang.String getPlatformName()
                                 throws java.rmi.RemoteException
Description copied from interface: AblePlatformSupport
Gets the platform's name as specified in the platform preference file.
Specified by:
getPlatformName in interface AblePlatformSupport
Following copied from interface: com.ibm.able.platform.AblePlatformSupport
Returns:
The platform's name.
Throws:
java.rmi.RemoteException - On any error.

getPlatformSecurity

public boolean getPlatformSecurity()
                            throws java.rmi.RemoteException
Description copied from interface: AblePlatformSupport
Gets the overall ABLE security setting as specified in the ABLE preference file.
Specified by:
getPlatformSecurity in interface AblePlatformSupport
Following copied from interface: com.ibm.able.platform.AblePlatformSupport
Returns:
true if ABLE is operating with security on; false otherwise.
Throws:
java.rmi.RemoteException - On any error.

getPlatformService

public javax.agent.service.Service getPlatformService(java.lang.String theRequestorsPort,
                                                      java.lang.String theServiceAlias)
                                               throws java.rmi.RemoteException
Description copied from interface: AblePlatformSupport
Gets the specified platform Service object.

Note that the ServiceManager is called to find the specified service, and that the ServiceManager will use the specified service's factory to "get" the service. "Getting" the service may be as simple as an RMI look up, or it may involve creating the service from scratch.

Specified by:
getPlatformService in interface AblePlatformSupport
Following copied from interface: com.ibm.able.platform.AblePlatformSupport
Parameters:
theRequestorsPort - The port, if any (may be null), of the object requesting the service object. This is used to help determine whether the requestor is running in the same agent pool as the specified Service.

theServiceAlias - The binding name of the service to be returned.

Returns:
The specified Service, if found. If not found, that is, the service couldn't be successfully looked up or created, an exception is thrown.
Throws:
java.rmi.RemoteException - On any error.

getPlatformServiceRoot

public javax.agent.service.ServiceRoot getPlatformServiceRoot(java.lang.String theRequestorsPort)
                                                       throws java.rmi.RemoteException
Description copied from interface: AblePlatformSupport
Gets the platform's service root.
Specified by:
getPlatformServiceRoot in interface AblePlatformSupport
Following copied from interface: com.ibm.able.platform.AblePlatformSupport
Parameters:
theRequestorsPort - The port, if any (may be null), of the object requesting the service root. This is used to help determine whether the requestor is running in the same agent pool as any Service that may need to be constructed.

Returns:
The platform's service root.
Throws:
java.rmi.RemoteException - On any error.

getPlatformAgentPools

public java.util.Hashtable getPlatformAgentPools()
                                          throws java.rmi.RemoteException
Description copied from interface: AblePlatformSupport
Gets a collection of agent pool definitions as specified in the platform preference file.
Specified by:
getPlatformAgentPools in interface AblePlatformSupport
Following copied from interface: com.ibm.able.platform.AblePlatformSupport
Returns:
A collection of AblePlatformPreferences.AgentPoolEntry_ objects, where each object in the collection represents an agent pool definition from the platform preference file. The key to the collection is a string that is the alias of each agent pool as defined in the preference file.
Throws:
java.rmi.RemoteException - On any error.

terminatePlatformSupport

public void terminatePlatformSupport(AbleSecureKey theSecureKey)
                              throws java.rmi.RemoteException,
                                     javax.agent.service.naming.NamingException
Description copied from interface: AblePlatformSupport
Terminates this AblePlatformSupport object and the agent pool in which it is running.

The following actions occur:

  • All nonessential platform services running in the agent pool are terminated.
  • If the AgentLifeCycleService is running here, it is terminated.
  • If the AgentNamingService is running here, it is terminated last.
  • PlatformSupport is unbound from the Registry.
  • The VM is exited.

Please note the following:

  • The caller should ask AgentLifeCycleService to quiesce all agents running in this agent pool before calling this method. This method does nothing with running agents.
  • The AblePlatformSupport object containing AgentLifeCycleService should be terminated next to last.
  • The AblePlatformSupport object containing AgentNamingService should be terminated last.
Specified by:
terminatePlatformSupport in interface AblePlatformSupport
Following copied from interface: com.ibm.able.platform.AblePlatformSupport
Parameters:
theSecureKey - When platform security is off, this parameter may be null; otherwise, this must be a valid security key from a caller with the proper authority to terminate this platform support object and the agent pool in which it is running.

Throws:
java.rmi.RemoteException - On any error.

main

public static void main(java.lang.String[] theArgs)
Creates an AblePlatformSupport object. The object registers itself with RMI and will sit and listen for incoming ABLE platform requests.
Parameters:
theArgs - A single element is expected: the port number on which this object is to listen.


Copyright

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

ABLE 2.0.0 07/02/2003 10:25:01

(C) Copyright IBM Corporation 1999, 2003