jrunx.kernel
Class ServicePartition

jrunx.kernel.ServiceAdapter
  |
  +--jrunx.kernel.ServicePartition
All Implemented Interfaces:
javax.naming.Referenceable, java.io.Serializable, Service, ServiceMBean, ServicePartitionMBean
Direct Known Subclasses:
ConfigurableServicePartition, JMSServicePartition, JRunJMSAdapter

public abstract class ServicePartition
extends ServiceAdapter
implements ServicePartitionMBean

Implementation of a Service Partition. Itmakes use of JMX domains in order to isolate the Services it contains. ServicePartition extensions can create their Services programmatically, through the use of metadata, or in any other manner as described in the Service. Regardless, the ServicePartition must have a domain name associated with it. If one is not explicitly assigned, then the Service's name will be used as the domain name. If the service has no name and no domain name, a ServiceException is thrown.

Author:
PS Neville, Karl Moss
See Also:
Serialized Form

Field Summary
protected  java.util.ArrayList sortedServices
           
 
Fields inherited from class jrunx.kernel.ServiceAdapter
DEFAULT_DEACTIVATED, DEFAULT_DOMAIN, DOMAIN_NAME_SEPARATOR, DOMAIN_NAME_SUFFIX, domainName, jndiBindable, LOGGER_CACHE_TIME, SCHEDULER_SERVICE, SECURITY_MANAGER, server, status, TRANSACTION_MANAGER
 
Fields inherited from interface jrunx.kernel.Service
INITIALIZED, STARTED, STARTING, STOPPED, STOPPING, UNINITIALIZED
 
Constructor Summary
ServicePartition()
           
 
Method Summary
 void addService(ServiceMBean service)
          Add a ServiceMBean to the partitioned Services.
 void addService(ServiceMBean service, javax.management.ObjectName serviceName)
          Add a ServiceMBean to the partitioned Services using the specified ObjectName for the Service.
 java.util.Iterator getServices()
          This method returns the actual instances of the registered services for this partition.
protected  void invokeChain(java.lang.String methodName, java.lang.Object[] params, java.lang.String[] types)
          Invokes all of the services in the chain of services for this partition.
 java.util.Iterator iterator()
          Return an iteration of these partitioned services.
 void removeService(javax.management.ObjectName objectName)
          Remove a ServiceMBean from the partitioned Services by its ObjectName
 void removeService(ServiceMBean service)
          Remove a ServiceMBean from the partitioned Services
 
Methods inherited from class jrunx.kernel.ServiceAdapter
bind, destroy, findObjectInstance, findObjectInstance, findObjectInstance, getBindToJNDI, getDeactivated, getDomainName, getDomainSearchPath, getJRunService, getLogger, getName, getParentService, getReference, getResourceManager, getServerName, getServerProperties, getStatus, init, invokeMethod, isInPartition, isPartition, lookup, postDeregister, postRegister, preDeregister, preRegister, requestServer, scheduleRunnable, setBindToJNDI, setDeactivated, setDomainName, setName, setParentService, start, stop, toString, unbind, unscheduleRunnable, updateStatus
 
Methods inherited from interface jrunx.kernel.ServiceMBean
bind, getBindToJNDI, getDeactivated, getDomainName, getJRunService, getLogger, getName, getParentService, getServerName, requestServer, setBindToJNDI, setDeactivated, setDomainName, setName, setParentService, unbind
 
Methods inherited from interface jrunx.kernel.Service
destroy, getStatus, init, start, stop, updateStatus
 

Field Detail

sortedServices

protected java.util.ArrayList sortedServices
Constructor Detail

ServicePartition

public ServicePartition()
Method Detail

addService

public void addService(ServiceMBean service)
                throws java.lang.Exception
Add a ServiceMBean to the partitioned Services.
Specified by:
addService in interface ServicePartitionMBean

addService

public void addService(ServiceMBean service,
                       javax.management.ObjectName serviceName)
                throws java.lang.Exception
Add a ServiceMBean to the partitioned Services using the specified ObjectName for the Service.
Specified by:
addService in interface ServicePartitionMBean

removeService

public void removeService(ServiceMBean service)
                   throws java.lang.Exception
Remove a ServiceMBean from the partitioned Services
Specified by:
removeService in interface ServicePartitionMBean

removeService

public void removeService(javax.management.ObjectName objectName)
                   throws java.lang.Exception
Remove a ServiceMBean from the partitioned Services by its ObjectName
Specified by:
removeService in interface ServicePartitionMBean

iterator

public java.util.Iterator iterator()
Description copied from interface: ServicePartitionMBean
Return an iteration of these partitioned services.
Specified by:
iterator in interface ServicePartitionMBean

getServices

public java.util.Iterator getServices()
This method returns the actual instances of the registered services for this partition. This would be handy, for example, when you need to access the services directly (not via JMX).

invokeChain

protected void invokeChain(java.lang.String methodName,
                           java.lang.Object[] params,
                           java.lang.String[] types)
Invokes all of the services in the chain of services for this partition. It is assumed that the services follow an interceptor pattern where the method invoked returns a Boolean that determines whether the next service in the chain should be invoked
Parameters:
methodName - The method name
params - The parameters
types - The parameter types


Copyright � 2002 Macromedia Corporation. All Rights Reserved.