com.sun.jini.compat.admin1
Class ReggieServiceAdmin

java.lang.Object
  extended bycom.sun.jini.compat.admin1.ReggieServiceAdmin
All Implemented Interfaces:
BasicAdmin, BasicServiceAdmin

public class ReggieServiceAdmin
extends java.lang.Object
implements BasicServiceAdmin

This class implements the BasicServiceAdmin interface to automate the testing of the Reggie lookup service implementation, which is part of the Jini(TM) Technology Software Kit (JSK). This admin treats Reggie as a service by asking it to join the "public" group.


Field Summary
 
Fields inherited from interface com.sun.jini.compat.harness.BasicServiceAdmin
CATEGORY
 
Constructor Summary
ReggieServiceAdmin()
          Default constructor with no arguments.
ReggieServiceAdmin(java.lang.String codebase)
          Constructor that takes a codebase for the Reggie implementation that is being tested.
 
Method Summary
 java.net.InetAddress getAddress()
          Returns the address that the Reggie service is running on.
 ServiceTemplate getTemplate()
          Provides a service template with the ServiceID of the lookup service, to filter out uninteresting services.
 ServiceItem pickService(ServiceItem[] services)
          Given an array of ServiceItem objects, this method determines if any of them are the lookup service that associated with this service admin.
 void setConfig(Config conf)
          Takes the Config object for this test run so that the implementation can get access to property files and other config information.
 void start()
          This method properly configures and starts a Reggie lookup service implementation.
 void stop()
          Stops the Reggie 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

ReggieServiceAdmin

public ReggieServiceAdmin()
Default constructor with no arguments.


ReggieServiceAdmin

public ReggieServiceAdmin(java.lang.String codebase)
Constructor that takes a codebase for the Reggie implementation that is being tested.

Method Detail

setConfig

public void setConfig(Config conf)
Takes the Config object for this test run so that the implementation can get access to property files and other config information.

Specified by:
setConfig in interface BasicAdmin
Parameters:
conf - the Config object for this test run

start

public void start()
           throws java.rmi.RemoteException
This method properly configures and starts a Reggie lookup service implementation. This method sets the CLASSPATH, the log directory, the java.rmi.server.codebase property, and the java.security.policy property for the lookup service. It starts a Reggie lookup service in a separate VM as a member of the public group and asks it to join the public group.

Specified by:
start in interface BasicAdmin
Throws:
java.rmi.RemoteException

pickService

public ServiceItem pickService(ServiceItem[] services)
                        throws java.rmi.RemoteException
Given an array of ServiceItem objects, this method determines if any of them are the lookup service that associated with this service admin. It does this by comparing the class name and the codebase of the ServiceItem instances to the codebase and class name it is looking for. If a match is found, the matching ServiceItem is returned; if no match is found, then null is returned.

Specified by:
pickService in interface BasicServiceAdmin
Parameters:
services - the array of ServiceItem objects from which to choose
Returns:
the ServiceItem for the Reggie service being tested, or null
Throws:
java.rmi.RemoteException

getAddress

public java.net.InetAddress getAddress()
                                throws java.rmi.RemoteException
Returns the address that the Reggie service is running on.

Specified by:
getAddress in interface BasicAdmin
Returns:
the address
Throws:
java.rmi.RemoteException

getTemplate

public ServiceTemplate getTemplate()
                            throws java.rmi.RemoteException
Provides a service template with the ServiceID of the lookup service, to filter out uninteresting services.

Specified by:
getTemplate in interface BasicServiceAdmin
Returns:
the template
Throws:
java.rmi.RemoteException

stop

public void stop()
          throws java.rmi.RemoteException
Stops the Reggie service, removes it from activation and removes it's log directory using remote administration.

Specified by:
stop in interface BasicAdmin
Throws:
java.rmi.RemoteException


Copyright 2005, Sun Microsystems, Inc.
Licensed under the Apache License, Version 2.0.