org.objectweb.proactive.core.body.rmi
Class RmiRemoteBodyForwarderImpl

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended byjava.rmi.server.UnicastRemoteObject
              extended byorg.objectweb.proactive.core.body.rmi.RmiRemoteBodyForwarderImpl
All Implemented Interfaces:
java.rmi.Remote, RemoteBodyForwarder, RmiRemoteBodyForwarder, java.io.Serializable

public class RmiRemoteBodyForwarderImpl
extends java.rmi.server.UnicastRemoteObject
implements RmiRemoteBodyForwarder

An adapter for a LocalBody to be able to receive remote calls. This helps isolate RMI-specific code into a small set of specific classes, thus enabling reuse if we one day decide to switch to anothe remote objects library.

See Also:
Serialized Form

Field Summary
protected  UniversalBodyForwarder body
          The encapsulated local body transient to deal with custom serialization of requests.
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface org.objectweb.proactive.core.body.RemoteBodyForwarder
bodyLogger
 
Constructor Summary
RmiRemoteBodyForwarderImpl()
           
RmiRemoteBodyForwarderImpl(UniversalBodyForwarder body)
           
RmiRemoteBodyForwarderImpl(UniversalBodyForwarder body, java.rmi.server.RMIServerSocketFactory sf, java.rmi.server.RMIClientSocketFactory cf)
           
 
Method Summary
 void addNFEListener(UniqueID id, NFEListener listener)
           
 void changeProxiedBody(UniqueID id, Body newBody)
           
 void disableAC(UniqueID id)
           
 void enableAC(UniqueID id)
           
 int fireNFE(UniqueID id, NonFunctionalException e)
           
 java.security.cert.X509Certificate getCertificate(UniqueID id)
           
 byte[] getCertificateEncoded(UniqueID id)
           
 java.util.ArrayList getEntities(UniqueID id)
           
 UniqueID getID(UniqueID id)
           
 java.lang.String getJobID(UniqueID id)
           
 java.lang.String getNodeURL(UniqueID id)
           
 SecurityContext getPolicy(UniqueID id, SecurityContext securityContext)
           
 java.security.PublicKey getPublicKey(UniqueID id)
           
 BodyAdapter getRemoteAdapter(UniqueID id)
           
 UniversalBody lookup(UniqueID id, java.lang.String url)
           
 byte[][] publicKeyExchange(UniqueID id, long sessionID, byte[] my_pub, byte[] my_cert, byte[] sig_code)
           
 byte[] randomValue(UniqueID id, long sessionID, byte[] cl_rand)
           
 java.lang.Object receiveFTMessage(UniqueID id, FTMessage fte)
           
 int receiveReply(UniqueID id, Reply r)
           
 int receiveRequest(UniqueID id, Request r)
           
 void register(UniqueID id, java.lang.String url)
           
 void removeImmediateService(UniqueID id, java.lang.String methodName, java.lang.Class[] parametersTypes)
           
 void removeNFEListener(UniqueID id, NFEListener listener)
           
 byte[][] secretKeyExchange(UniqueID id, long sessionID, byte[] encodedAESKey, byte[] encodedIVParameters, byte[] encodedClientMacKey, byte[] encodedLockData, byte[] parametersSignature)
           
 void setImmediateService(UniqueID id, java.lang.String methodName)
           
 void setImmediateService(UniqueID id, java.lang.String methodName, java.lang.Class[] parametersTypes)
           
 long startNewSession(UniqueID id, Communication policy)
           
 void terminate(UniqueID id)
           
 void terminateSession(UniqueID id, long sessionID)
           
 void unreferenced(UniqueID id)
           
 void unregister(UniqueID id, java.lang.String url)
           
 void updateLocation(UniqueID id, UniqueID uid, UniversalBody remoteBody)
           
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

body

protected transient UniversalBodyForwarder body
The encapsulated local body transient to deal with custom serialization of requests.

Constructor Detail

RmiRemoteBodyForwarderImpl

public RmiRemoteBodyForwarderImpl()
                           throws java.rmi.RemoteException

RmiRemoteBodyForwarderImpl

public RmiRemoteBodyForwarderImpl(UniversalBodyForwarder body)
                           throws java.rmi.RemoteException

RmiRemoteBodyForwarderImpl

public RmiRemoteBodyForwarderImpl(UniversalBodyForwarder body,
                                  java.rmi.server.RMIServerSocketFactory sf,
                                  java.rmi.server.RMIClientSocketFactory cf)
                           throws java.rmi.RemoteException
Method Detail

receiveRequest

public int receiveRequest(UniqueID id,
                          Request r)
                   throws java.io.IOException,
                          RenegotiateSessionException
Specified by:
receiveRequest in interface RemoteBodyForwarder
Throws:
java.io.IOException
RenegotiateSessionException
See Also:
RemoteBody.receiveRequest(Request)

receiveReply

public int receiveReply(UniqueID id,
                        Reply r)
                 throws java.io.IOException
Specified by:
receiveReply in interface RemoteBodyForwarder
Throws:
java.io.IOException
See Also:
RemoteBody.receiveReply(Reply)

terminate

public void terminate(UniqueID id)
               throws java.io.IOException
Specified by:
terminate in interface RemoteBodyForwarder
Throws:
java.io.IOException
See Also:
RemoteBody.terminate()

getNodeURL

public java.lang.String getNodeURL(UniqueID id)
Specified by:
getNodeURL in interface RemoteBodyForwarder
See Also:
RemoteBody.getNodeURL()

getID

public UniqueID getID(UniqueID id)
Specified by:
getID in interface RemoteBodyForwarder
See Also:
RemoteBody.getID()

updateLocation

public void updateLocation(UniqueID id,
                           UniqueID uid,
                           UniversalBody remoteBody)
                    throws java.io.IOException
Specified by:
updateLocation in interface RemoteBodyForwarder
Throws:
java.io.IOException
See Also:
RemoteBody.updateLocation(UniqueID, UniversalBody)

unreferenced

public void unreferenced(UniqueID id)

enableAC

public void enableAC(UniqueID id)
              throws java.io.IOException
Specified by:
enableAC in interface RemoteBodyForwarder
Throws:
java.io.IOException
See Also:
RemoteBody.enableAC()

disableAC

public void disableAC(UniqueID id)
               throws java.io.IOException
Specified by:
disableAC in interface RemoteBodyForwarder
Throws:
java.io.IOException
See Also:
RemoteBody.disableAC()

setImmediateService

public void setImmediateService(UniqueID id,
                                java.lang.String methodName)
                         throws java.io.IOException
Specified by:
setImmediateService in interface RemoteBodyForwarder
Throws:
java.io.IOException
See Also:
RemoteBody.setImmediateService(String)

removeImmediateService

public void removeImmediateService(UniqueID id,
                                   java.lang.String methodName,
                                   java.lang.Class[] parametersTypes)
                            throws java.io.IOException
Specified by:
removeImmediateService in interface RemoteBodyForwarder
Throws:
java.io.IOException
See Also:
RemoteBody.removeImmediateService(String, Class[])

setImmediateService

public void setImmediateService(UniqueID id,
                                java.lang.String methodName,
                                java.lang.Class[] parametersTypes)
                         throws java.io.IOException
Specified by:
setImmediateService in interface RemoteBodyForwarder
Throws:
java.io.IOException
See Also:
RemoteBody.setImmediateService(String, Class[])

terminateSession

public void terminateSession(UniqueID id,
                             long sessionID)
                      throws java.io.IOException,
                             SecurityNotAvailableException
Specified by:
terminateSession in interface RemoteBodyForwarder
Throws:
java.io.IOException
SecurityNotAvailableException

getCertificate

public java.security.cert.X509Certificate getCertificate(UniqueID id)
                                                  throws SecurityNotAvailableException,
                                                         java.io.IOException
Specified by:
getCertificate in interface RemoteBodyForwarder
Throws:
SecurityNotAvailableException
java.io.IOException

startNewSession

public long startNewSession(UniqueID id,
                            Communication policy)
                     throws SecurityNotAvailableException,
                            java.io.IOException,
                            RenegotiateSessionException
Specified by:
startNewSession in interface RemoteBodyForwarder
Throws:
SecurityNotAvailableException
java.io.IOException
RenegotiateSessionException

getPublicKey

public java.security.PublicKey getPublicKey(UniqueID id)
                                     throws SecurityNotAvailableException,
                                            java.io.IOException
Specified by:
getPublicKey in interface RemoteBodyForwarder
Throws:
SecurityNotAvailableException
java.io.IOException

randomValue

public byte[] randomValue(UniqueID id,
                          long sessionID,
                          byte[] cl_rand)
                   throws RenegotiateSessionException,
                          java.io.IOException,
                          SecurityNotAvailableException
Specified by:
randomValue in interface RemoteBodyForwarder
Throws:
RenegotiateSessionException
java.io.IOException
SecurityNotAvailableException

publicKeyExchange

public byte[][] publicKeyExchange(UniqueID id,
                                  long sessionID,
                                  byte[] my_pub,
                                  byte[] my_cert,
                                  byte[] sig_code)
                           throws java.io.IOException,
                                  RenegotiateSessionException,
                                  SecurityNotAvailableException,
                                  KeyExchangeException
Specified by:
publicKeyExchange in interface RemoteBodyForwarder
Throws:
java.io.IOException
RenegotiateSessionException
SecurityNotAvailableException
KeyExchangeException

getCertificateEncoded

public byte[] getCertificateEncoded(UniqueID id)
                             throws java.io.IOException,
                                    SecurityNotAvailableException
Specified by:
getCertificateEncoded in interface RemoteBodyForwarder
Throws:
java.io.IOException
SecurityNotAvailableException

getPolicy

public SecurityContext getPolicy(UniqueID id,
                                 SecurityContext securityContext)
                          throws java.io.IOException,
                                 SecurityNotAvailableException
Specified by:
getPolicy in interface RemoteBodyForwarder
Throws:
java.io.IOException
SecurityNotAvailableException

getEntities

public java.util.ArrayList getEntities(UniqueID id)
                                throws SecurityNotAvailableException,
                                       java.io.IOException
Specified by:
getEntities in interface RemoteBodyForwarder
Throws:
SecurityNotAvailableException
java.io.IOException

receiveFTMessage

public java.lang.Object receiveFTMessage(UniqueID id,
                                         FTMessage fte)
                                  throws java.io.IOException
Specified by:
receiveFTMessage in interface RemoteBodyForwarder
Throws:
java.io.IOException

changeProxiedBody

public void changeProxiedBody(UniqueID id,
                              Body newBody)
                       throws java.io.IOException
Specified by:
changeProxiedBody in interface RemoteBodyForwarder
Throws:
java.io.IOException

addNFEListener

public void addNFEListener(UniqueID id,
                           NFEListener listener)
                    throws java.io.IOException
Specified by:
addNFEListener in interface RemoteBodyForwarder
Throws:
java.io.IOException

removeNFEListener

public void removeNFEListener(UniqueID id,
                              NFEListener listener)
                       throws java.io.IOException
Specified by:
removeNFEListener in interface RemoteBodyForwarder
Throws:
java.io.IOException

fireNFE

public int fireNFE(UniqueID id,
                   NonFunctionalException e)
            throws java.io.IOException
Specified by:
fireNFE in interface RemoteBodyForwarder
Throws:
java.io.IOException

getJobID

public java.lang.String getJobID(UniqueID id)
                          throws java.io.IOException
Specified by:
getJobID in interface RemoteBodyForwarder
Throws:
java.io.IOException
See Also:
RemoteBody.getJobID()

lookup

public UniversalBody lookup(UniqueID id,
                            java.lang.String url)
                     throws java.io.IOException
Specified by:
lookup in interface RemoteBodyForwarder
Throws:
java.io.IOException

register

public void register(UniqueID id,
                     java.lang.String url)
              throws java.io.IOException
Specified by:
register in interface RemoteBodyForwarder
Throws:
java.io.IOException

unregister

public void unregister(UniqueID id,
                       java.lang.String url)
                throws java.io.IOException
Specified by:
unregister in interface RemoteBodyForwarder
Throws:
java.io.IOException

getRemoteAdapter

public BodyAdapter getRemoteAdapter(UniqueID id)
Specified by:
getRemoteAdapter in interface RemoteBodyForwarder

secretKeyExchange

public byte[][] secretKeyExchange(UniqueID id,
                                  long sessionID,
                                  byte[] encodedAESKey,
                                  byte[] encodedIVParameters,
                                  byte[] encodedClientMacKey,
                                  byte[] encodedLockData,
                                  byte[] parametersSignature)
                           throws SecurityNotAvailableException,
                                  RenegotiateSessionException,
                                  java.io.IOException
Specified by:
secretKeyExchange in interface RemoteBodyForwarder
Throws:
SecurityNotAvailableException
RenegotiateSessionException
java.io.IOException


Copyright 2001-2005 INRIA All Rights Reserved.