com.sun.jini.compat.admin1
Class MahaloAdmin

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

public class MahaloAdmin
extends java.lang.Object
implements BasicServiceAdmin

This class implements the BasicServiceAdmin interface to automate the testing of the Mahalo Transaction Manager service from the Jini(TM) Technology Software Kit (JSK).


Field Summary
 
Fields inherited from interface com.sun.jini.compat.harness.BasicServiceAdmin
CATEGORY
 
Constructor Summary
MahaloAdmin()
          Default Constructor with no arguments.
MahaloAdmin(java.lang.String codebase)
          Constructor that takes in the codebase for the Mahalo implementation that is being tested.
 
Method Summary
 java.net.InetAddress getAddress()
          Returns the address of the machine that the Mahalo process is running on.
 ServiceTemplate getTemplate()
          Provides a service template with the Mahalo'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 Mahalo we are testing.
 void setConfig(Config conf)
          Takes the Config object for this test run so that the implementation can get access to property files and and other config information.
 void start()
          Properly configures and starts Mahalo.
 void stop()
          Stops the Mahalo 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

MahaloAdmin

public MahaloAdmin()
Default Constructor with no arguments.


MahaloAdmin

public MahaloAdmin(java.lang.String codebase)
Constructor that takes in the codebase for the Mahalo 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 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
Properly configures and starts Mahalo. This method sets the codebase, classpath, policy and log directory for Mahalo. It then starts Mahalo in a separate VM and using remote administration configures Mahalo to register in the public group.

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

pickService

public ServiceItem pickService(ServiceItem[] services)
                        throws java.rmi.RemoteException
Given a list of objects which are ServiceItems this method determines if any of them are the Mahalo we are testing. It does this by comparing the class name and the codebase of the object to the codebase and class name we are looking for. If they match it returns the matching ServiceItem; otherwise it returns null.

Specified by:
pickService in interface BasicServiceAdmin
Parameters:
services - the array of ServiceItems that need to be picked from
Returns:
the ServiceItem for the Mahalo service being tested or null
Throws:
java.rmi.RemoteException

getAddress

public java.net.InetAddress getAddress()
                                throws java.rmi.RemoteException
Returns the address of the machine that the Mahalo process 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 Mahalo's ServiceID 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 Mahalo 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.