|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.jini.compat.admin1.TransientServiceAdmin
This class implements the BasicServiceAdmin
interface
to automate the testing of a transient service. A transient service
by definition of this admin is one that is started using the following
command line.
java -jar -Djava.security.policy=security_policy_file_arg
-Djava.rmi.server.codebase=codebase_arg
[optional_jvm_options] executable_jar_file
-jar
-jar
is ajava
command-line option that tells the interpreter to execute a program encapsulated in a JAR file. The following links provide more detail on this option.http://java.sun.com/products/jdk/1.2/docs/tooldocs/solaris/java.html#-jar http://java.sun.com/products/jdk/1.2/docs/tooldocs/win32/java.html#-jar
security_policy_file_arg
- This argument is used to specify the security policy file that the TransientService will run under.
codebase_arg
- This argument is used to specify the URL of the
service-dl.jar
that will be downloaded to clients. This JAR file contains the classes required by clients in order to interact with the TransientService server.
optional_jvm_options
- These are optional arguments for the VM that the TransientService will run in. The following links give more detail on what arguments can be passed to a VM.
http://java.sun.com/products/jdk/1.2/docs/tooldocs/solaris/java.html http://java.sun.com/products/jdk/1.2/docs/tooldocs/win32/java.html
executable_jar_file
- This JAR file contains a program that is identified by the manifest as having a
main
method. In this case, this argument would be the absolute path to theservice.jar
file, which has its Main-Class attribute. For more information on the-jar
option of thejava
command, you can take a look at:http://java.sun.com/products/jdk/1.2/docs/tooldocs/solaris/java.html http://java.sun.com/products/jdk/1.2/docs/tooldocs/win32/java.html http://java.sun.com/products/jdk/1.2/docs/guide/jar/manifest.html http://java.sun.com/products/jdk/1.2/docs/tooldocs/solaris/jar.html http://java.sun.com/products/jdk/1.2/docs/tooldocs/win32/jar.html
Because transient services are not activatable, it is necessary to start them in a separate VM to avoid codebase and classpath problems in certain LDJ Kit tests.
In order to use this Admin several properties must be defined in the
LDJ Kit config file. See the documentation for the start
method
below for more information.
Field Summary |
Fields inherited from interface com.sun.jini.compat.harness.BasicServiceAdmin |
CATEGORY |
Constructor Summary | |
TransientServiceAdmin()
Default Constructor with no arguments. |
|
TransientServiceAdmin(java.lang.String codebase)
Constructor that takes in the codebase for the service implementation that is being tested. |
Method Summary | |
java.net.InetAddress |
getAddress()
Returns the address of the machine that the service process is running on. |
ServiceTemplate |
getTemplate()
Provides a service template with the service's ServiceID to filter out uninteresting services. |
ServiceItem |
pickService(ServiceItem[] services)
Given a list of objects which are ServiceItems this method determines if any of them are the service we are testing. |
void |
setConfig(Config conf)
Sets the Config object for this test run that the implementation can get access to property files and other config information. |
void |
start()
Properly configures and starts the service. |
void |
stop()
Stops the service, removes it from activation and removes it's log directory using remote administration. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TransientServiceAdmin()
public TransientServiceAdmin(java.lang.String codebase)
Method Detail |
public void setConfig(Config conf)
setConfig
in interface BasicAdmin
conf
- the Config object for this test runpublic void start() throws java.rmi.RemoteException
Below is a table describing all required and optional properties used by this admin.
Property | Usage | Status |
---|---|---|
com.sun.jini.compat.service.proxyclass | The fully qualified class name of the service's proxy | Mandatory |
com.sun.jini.compat.service.jarfile | The full path of executable JAR file for starting service | Mandatory |
com.sun.jini.compat.service.codebase | The codebase for any code published by the service under test | Mandatory |
com.sun.jini.compat.service.policy | The location of a policy file for use in starting the service | Mandatory |
com.sun.jini.compat.service.optional_jvm_args | Any additional args passed to the VM (must include -D) | Optional |
com.sun.jini.compat.service.optional_service_args | Any additional arguments passed to the service | Optional |
com.sun.jini.compat.service.java | The full path of the VM that is used to start service | Optional |
start
in interface BasicAdmin
java.rmi.RemoteException
public ServiceItem pickService(ServiceItem[] services) throws java.rmi.RemoteException
pickService
in interface BasicServiceAdmin
services
- the array of ServiceItems that need to be picked from
java.rmi.RemoteException
public java.net.InetAddress getAddress() throws java.rmi.RemoteException
getAddress
in interface BasicAdmin
java.rmi.RemoteException
public ServiceTemplate getTemplate() throws java.rmi.RemoteException
getTemplate
in interface BasicServiceAdmin
java.rmi.RemoteException
public void stop() throws java.rmi.RemoteException
stop
in interface BasicAdmin
java.rmi.RemoteException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |