org.jboss.ha.framework.server
Class HARMIServerImpl

java.lang.Object
  extended byorg.jboss.ha.framework.server.HARMIServerImpl
All Implemented Interfaces:
HARMIServer (src) , java.rmi.Remote

public class HARMIServerImpl
extends java.lang.Object
implements HARMIServer (src)

This class is a server-side proxy for replicated RMI objects.


Nested Class Summary
 class HARMIServerImpl.RefreshProxiesHATarget (src)
           
 
Field Summary
protected  java.lang.Object handler
           
protected  java.lang.Class intf
           
protected  java.util.Map invokerMap
           
protected  java.lang.String key
           
protected  Logger (src) log
           
protected  java.rmi.server.RemoteStub rmistub
           
protected  java.lang.Object stub
           
protected  HARMIServerImpl.RefreshProxiesHATarget (src) target
           
 
Fields inherited from interface org.jboss.ha.framework.interfaces.HARMIServer (src)
rmiServers
 
Constructor Summary
HARMIServerImpl(HAPartition (src)  partition, java.lang.String replicantName, java.lang.Class intf, java.lang.Object handler)
          Create a new HARMIServer implementation that will act as a RMI end-point for a specific server.
HARMIServerImpl(HAPartition (src)  partition, java.lang.String replicantName, java.lang.Class intf, java.lang.Object handler, int port, java.rmi.server.RMIClientSocketFactory csf, java.rmi.server.RMIServerSocketFactory ssf)
           
HARMIServerImpl(HAPartition (src)  partition, java.lang.String replicantName, java.lang.Class intf, java.lang.Object handler, int port, java.rmi.server.RMIClientSocketFactory clientSocketFactory, java.rmi.server.RMIServerSocketFactory serverSocketFactory, java.net.InetAddress bindAddress)
           
 
Method Summary
 java.lang.Object createHAStub(LoadBalancePolicy (src)  policy)
          Once a HARMIServer implementation exists, it is possible to ask for a stub that can, for example, be bound in JNDI for client use.
 void destroy()
           
 java.lang.Object getLocal()
          Get local stub for this service.
 java.util.List getReplicants()
          Returns a list of node stubs that are current replica of this service.
 HARMIResponse (src) invoke(long clientViewId, MarshalledInvocation (src)  mi)
          Performs an invocation through this HA-RMI for the target object hidden behind it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

handler

protected java.lang.Object handler

invokerMap

protected java.util.Map invokerMap

log

protected Logger (src)  log

rmistub

protected java.rmi.server.RemoteStub rmistub

stub

protected java.lang.Object stub

key

protected java.lang.String key

intf

protected java.lang.Class intf

target

protected HARMIServerImpl.RefreshProxiesHATarget (src)  target
Constructor Detail

HARMIServerImpl

public HARMIServerImpl(HAPartition (src)  partition,
                       java.lang.String replicantName,
                       java.lang.Class intf,
                       java.lang.Object handler,
                       int port,
                       java.rmi.server.RMIClientSocketFactory csf,
                       java.rmi.server.RMIServerSocketFactory ssf)
                throws java.lang.Exception

HARMIServerImpl

public HARMIServerImpl(HAPartition (src)  partition,
                       java.lang.String replicantName,
                       java.lang.Class intf,
                       java.lang.Object handler,
                       int port,
                       java.rmi.server.RMIClientSocketFactory clientSocketFactory,
                       java.rmi.server.RMIServerSocketFactory serverSocketFactory,
                       java.net.InetAddress bindAddress)
                throws java.lang.Exception

HARMIServerImpl

public HARMIServerImpl(HAPartition (src)  partition,
                       java.lang.String replicantName,
                       java.lang.Class intf,
                       java.lang.Object handler)
                throws java.lang.Exception
Create a new HARMIServer implementation that will act as a RMI end-point for a specific server.

Parameters:
partition - HAPartition (src) that will determine the cluster member
replicantName - Name of the service using this HARMIServer
intf - Class type under which should appear the RMI server dynamically built
handler - Target object to which calls will be forwarded
Throws:
java.lang.Exception - Thrown if any exception occurs during call forwarding
Method Detail

createHAStub

public java.lang.Object createHAStub(LoadBalancePolicy (src)  policy)
Once a HARMIServer implementation exists, it is possible to ask for a stub that can, for example, be bound in JNDI for client use. Each client stub may incorpore a specific load-balancing policy.

Parameters:
policy - LoadBalancePolicy (src) implementation to ues on the client.
Returns:

destroy

public void destroy()

invoke

public HARMIResponse (src)  invoke(long clientViewId,
                            MarshalledInvocation (src)  mi)
                     throws java.lang.Exception
Description copied from interface: HARMIServer (src)
Performs an invocation through this HA-RMI for the target object hidden behind it.

Specified by:
invoke in interface HARMIServer (src)
Throws:
java.lang.Exception

getReplicants

public java.util.List getReplicants()
                             throws java.lang.Exception
Description copied from interface: HARMIServer (src)
Returns a list of node stubs that are current replica of this service.

Specified by:
getReplicants in interface HARMIServer (src)
Throws:
java.lang.Exception

getLocal

public java.lang.Object getLocal()
                          throws java.lang.Exception
Description copied from interface: HARMIServer (src)
Get local stub for this service.

Specified by:
getLocal in interface HARMIServer (src)
Throws:
java.lang.Exception