jrunx.rmi
Class RMIBroker

jrunx.kernel.ServiceAdapter
  |
  +--jrunx.kernel.ServicePartition
        |
        +--jrunx.kernel.ConfigurableServicePartition
              |
              +--jrunx.cluster.ClusterableServiceAdapter
                    |
                    +--jrunx.rmi.RMIBroker
All Implemented Interfaces:
ClusterableService, ClusterableServiceAdapterMBean, ClusterConstants, ConfigurableServicePartitionMBean, javax.naming.Referenceable, java.rmi.Remote, RemoteConstants, RMIBrokerMBean, RMIBrokerRemote, java.io.Serializable, Service, ServiceMBean, ServicePartitionMBean

public class RMIBroker
extends ClusterableServiceAdapter
implements RMIBrokerMBean, RMIBrokerRemote, RemoteConstants

This class receives all remote method invocations from EJB's and remote and clusterable services. The invocations are encapsulated in an Invocation. The broker investigates the context's destination based on its systems and subsystem information, and passes it along to that destination. For example, it could see that an arriving Invocation is destined for a Service (the system field would denote that it is intended for a Serice, and the subsystem field would denote the service's JMX ObjectName), and subsequently pass it along to the appropriate JMX MBeanServer; or it could see that the invocation is destined for an EJB container (the system field would denote that it is intended for an EJB container, and the subsystem field would denote the unique container name), and pass it along to the appropriate EJB InvocationProxy. Caller-side invocation handlers and have a stub to this broker -- possibly several stubs, each one hosted on a unique JRun server, since this is a clusterable service.

Author:
PS Neville
See Also:
Serialized Form

Field Summary
static java.lang.String OBJECT_NAME
           
 
Fields inherited from class jrunx.cluster.ClusterableServiceAdapter
clientSocketFactoryName, defaultAlgorithm, myHost, myIP, myPeers, myStub, port, serverSocketFactoryName
 
Fields inherited from class jrunx.kernel.ServicePartition
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
 
Fields inherited from interface jrunx.rmi.RemoteConstants
EJB, EJB_CONTAINER, JDBC, JMS, SERVICE
 
Fields inherited from interface jrunx.cluster.ClusterConstants
AVAILABLE_SERVICES, CLUSTER_MANAGER_JNDI, DEFAULT_CLUSTER_DOMAIN, DEFAULT_ENABLED, JINI_CODE_BASE_JAR, PRIMARY_SERVICE, SECONDARY_SERVICE
 
Constructor Summary
RMIBroker()
           
 
Method Summary
static java.lang.Integer getClientThreadHashCode()
           
 java.lang.Object getInvoker(int type)
           
 Invocation invoke(Invocation inv)
          Override for custom invocation functionality
static void resetClientThreadHashCode()
           
static void setClientThreadHashCode(int hashCode)
           
 void start()
          Every service other than mere data collections should start
 void stop()
          Every service other than mere data collections should stop
 
Methods inherited from class jrunx.cluster.ClusterableServiceAdapter
addPeerListener, addServersToClients, destroy, getClientSocketFactory, getClusterAlgorithm, getPeers, getPort, getRemoteHostIP, getRemoteHostName, getRemoteServerName, getServerInfo, getServerSocketFactoryClass, init, isValidPeer, killRemoteServer, numPeers, setClientSocketFactoryClass, setClusterAlgorithm, setPort, setServerSocketFactoryClass, toStub
 
Methods inherited from class jrunx.kernel.ConfigurableServicePartition
destroyServices, initServices, loadAndInit, loadChildren, setChildElements, startServices, stopServices
 
Methods inherited from class jrunx.kernel.ServicePartition
addService, addService, getServices, invokeChain, iterator, removeService, removeService
 
Methods inherited from class jrunx.kernel.ServiceAdapter
bind, findObjectInstance, findObjectInstance, findObjectInstance, getBindToJNDI, getDeactivated, getDomainName, getDomainSearchPath, getJRunService, getLogger, getName, getParentService, getReference, getResourceManager, getServerName, getServerProperties, getStatus, invokeMethod, isInPartition, isPartition, lookup, postDeregister, postRegister, preDeregister, preRegister, requestServer, scheduleRunnable, setBindToJNDI, setDeactivated, setDomainName, setName, setParentService, toString, unbind, unscheduleRunnable, updateStatus
 
Methods inherited from interface jrunx.cluster.ClusterableServiceAdapterMBean
addPeerListener, getClientSocketFactory, getClusterAlgorithm, getPort, getServerSocketFactoryClass, setClientSocketFactoryClass, setClusterAlgorithm, setPort, setServerSocketFactoryClass
 
Methods inherited from interface jrunx.kernel.ConfigurableServicePartitionMBean
setChildElements
 
Methods inherited from interface jrunx.kernel.ServicePartitionMBean
addService, addService, iterator, removeService, removeService
 
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, updateStatus
 
Methods inherited from interface jrunx.cluster.ClusterableService
getPeers, getRemoteHostIP, getRemoteHostName, getRemoteServerName, getServerInfo, killRemoteServer, numPeers, toStub
 

Field Detail

OBJECT_NAME

public static final java.lang.String OBJECT_NAME
Constructor Detail

RMIBroker

public RMIBroker()
Method Detail

setClientThreadHashCode

public static void setClientThreadHashCode(int hashCode)

getClientThreadHashCode

public static java.lang.Integer getClientThreadHashCode()

resetClientThreadHashCode

public static void resetClientThreadHashCode()

start

public void start()
           throws java.lang.Exception
Description copied from class: ServiceAdapter
Every service other than mere data collections should start
Specified by:
start in interface Service
Overrides:
start in class ClusterableServiceAdapter

stop

public void stop()
          throws java.lang.Exception
Description copied from class: ServiceAdapter
Every service other than mere data collections should stop
Specified by:
stop in interface Service
Overrides:
stop in class ClusterableServiceAdapter

getInvoker

public java.lang.Object getInvoker(int type)
                            throws java.rmi.RemoteException
Specified by:
getInvoker in interface RMIBrokerRemote

invoke

public Invocation invoke(Invocation inv)
                  throws java.rmi.RemoteException
Description copied from class: ClusterableServiceAdapter
Override for custom invocation functionality
Specified by:
invoke in interface ClusterableService
Overrides:
invoke in class ClusterableServiceAdapter


Copyright � 2002 Macromedia Corporation. All Rights Reserved.