|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.proactive.core.body.AbstractUniversalBody
org.objectweb.proactive.core.body.AbstractBody
**For internal use only**
This class gives a common implementation of the Body interface. It provides all the non specific behavior allowing sub-class to write the detail implementation.
Each body is identify by an unique identifier.
All active bodies that get created in one JVM register themselves into a table that allows to tack them done. The registering and deregistering is done by the AbstractBody and the table is managed here as well using some static methods.
In order to let somebody customize the body of an active object without subclassing it, AbstractBody delegates lot of tasks to satellite objects that implements a given interface. Abstract protected methods instantiate those objects allowing subclasses to create them as they want (using customizable factories or instance).
Body
,
UniqueID
,
Serialized FormField Summary | |
protected FTManager |
ftmanager
|
protected InternalBodySecurity |
internalBodySecurity
|
protected boolean |
isInterfaceSecureImplemented
|
protected boolean |
isSecurityOn
|
protected LocalBodyStrategy |
localBodyStrategy
|
protected static org.apache.log4j.Logger |
logger
|
protected java.util.Hashtable |
openedSessions
|
protected ProActiveSecurityManager |
psm
|
protected ProActiveSPMDGroupManager |
spmdManager
|
protected ThreadStore |
threadStore
|
Fields inherited from class org.objectweb.proactive.core.body.AbstractUniversalBody |
bodyID, jobID, location, nodeURL, remoteBody, remoteBodyFactory |
Constructor Summary | |
AbstractBody()
Creates a new AbstractBody. |
|
AbstractBody(java.lang.Object reifiedObject,
java.lang.String nodeURL,
MetaObjectFactory factory,
java.lang.String jobId)
Creates a new AbstractBody for an active object attached to a given node. |
Method Summary | |
void |
acceptCommunication()
Signals the body to accept all incoming communications. |
protected void |
activityStarted()
Signals that the activity of this body, managed by the active thread has just started. |
protected void |
activityStopped()
Signals that the activity of this body, managed by the active thread has just stopped. |
void |
blockCommunication()
blocks all incoming communications. |
UniversalBody |
checkNewLocation(UniqueID bodyID)
Tries to find a local version of the body of id uniqueID. |
void |
clearHandlersLevel()
Clear the local map of handlers |
void |
disableAC()
Disables automatic continuation mechanism for this body |
void |
enableAC()
Enables automatic continuation mechanism for this body |
void |
enterInThreadStore()
Allows the calling thread to enter in the ThreadStore of this body. |
void |
exitFromThreadStore()
Allows the calling thread to exit from the ThreadStore of this body. |
java.security.cert.X509Certificate |
getCertificate()
|
byte[] |
getCertificateEncoded()
|
java.util.ArrayList |
getEntities()
|
FTManager |
getFTManager()
To get the FTManager of this body |
FuturePool |
getFuturePool()
Returns the future pool of this body |
java.lang.String |
getHandlerizableInfo()
Get information about the handlerizable object |
java.util.HashMap |
getHandlersLevel()
Give a reference to a local map of handlers |
java.lang.String |
getName()
Returns the name of this body that can be used for displaying information |
SecurityContext |
getPolicy(SecurityContext securityContext)
|
Policy |
getPolicyFrom(java.security.cert.X509Certificate certificate)
|
Communication |
getPolicyTo(java.lang.String type,
java.lang.String from,
java.lang.String to)
|
ProActiveSecurityManager |
getProActiveSecurityManager()
|
ProActiveSPMDGroupManager |
getProActiveSPMDGroupManager()
|
java.security.PublicKey |
getPublicKey()
|
java.lang.Object |
getReifiedObject()
Returns the reified object that body is for The reified object is the object that has been turned active. |
BlockingRequestQueue |
getRequestQueue()
Returns the request queue associated to this body |
java.lang.Object |
getSPMDGroup()
Returns the SPMD group of the active object |
int |
getSPMDGroupSize()
Returns the size of of the SPMD group |
java.lang.String |
getVNName()
|
void |
initiateSession(int type,
UniversalBody body)
|
protected abstract int |
internalReceiveReply(Reply reply)
Receives a reply in response to a former request. |
protected abstract int |
internalReceiveRequest(Request request)
Receives a request for later processing. |
boolean |
isActive()
Returns whether the body is active or not. |
boolean |
isAlive()
Returns whether the body is alive or not. |
ConfidentialityTicket |
negociateKeyReceiverSide(ConfidentialityTicket confidentialityTicket,
long sessionID)
|
byte[][] |
publicKeyExchange(long sessionID,
UniversalBody distantBody,
byte[] my_pub,
byte[] my_cert,
byte[] sig_code)
|
byte[] |
randomValue(long sessionID,
byte[] cl_rand)
|
int |
receiveFTMessage(FTMessage fte)
For sending a non fonctional message to the FTManager linked to this object. |
int |
receiveReply(Reply reply)
Receives a reply in response to a former request. |
int |
receiveRequest(Request request)
Receives a request for later processing. |
void |
renegociateSessionIfNeeded(long sID)
|
byte[][] |
secretKeyExchange(long sessionID,
byte[] tmp,
byte[] tmp1,
byte[] tmp2,
byte[] tmp3,
byte[] tmp4)
|
void |
sendRequest(MethodCall methodCall,
Future future,
UniversalBody destinationBody)
Sends the request request with the future future to the local body
body . |
void |
serve(Request request)
Serves the request. |
void |
setExceptionHandler(Handler handler,
java.lang.Class exception)
Set a new handler within the table of the Handlerizable Object |
void |
setFTManager(FTManager ftm)
To set the FTManager of this body |
protected void |
setLocalBodyImpl(LocalBodyStrategy localBody)
|
void |
setPolicyServer(PolicyServer server)
set the policy server of the active object |
void |
setSPMDGroup(java.lang.Object o)
Set the SPMD group for the active object |
protected void |
startDefaultProActiveSecurityManager()
|
long |
startNewSession(Communication policy)
|
void |
terminate()
Terminate the body. |
void |
terminateSession(long sessionID)
|
java.lang.String |
toString()
Returns a string representation of this object. |
Handler |
unsetExceptionHandler(java.lang.Class exception)
Remove a handler from the table of the Handlerizable Object |
Methods inherited from class org.objectweb.proactive.core.body.AbstractUniversalBody |
getID, getJobID, getNodeURL, getRemoteAdapter, updateLocation |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.objectweb.proactive.Body |
updateNodeURL |
Methods inherited from interface org.objectweb.proactive.core.body.UniversalBody |
getID, getNodeURL, getRemoteAdapter, setImmediateService, updateLocation |
Methods inherited from interface org.objectweb.proactive.Job |
getJobID |
Methods inherited from interface org.objectweb.proactive.core.body.message.MessageEventProducer |
addMessageEventListener, removeMessageEventListener |
Field Detail |
protected ThreadStore threadStore
protected LocalBodyStrategy localBodyStrategy
protected ProActiveSecurityManager psm
protected boolean isSecurityOn
protected transient InternalBodySecurity internalBodySecurity
protected java.util.Hashtable openedSessions
protected static org.apache.log4j.Logger logger
protected boolean isInterfaceSecureImplemented
protected ProActiveSPMDGroupManager spmdManager
protected FTManager ftmanager
Constructor Detail |
public AbstractBody()
public AbstractBody(java.lang.Object reifiedObject, java.lang.String nodeURL, MetaObjectFactory factory, java.lang.String jobId)
reifiedObject
- the active object that body is fornodeURL
- the URL of the node that body is attached tofactory
- the factory able to construct new factories for each type of meta objects
needed by this bodyMethod Detail |
public java.lang.String toString()
public int receiveRequest(Request request) throws java.io.IOException, RenegotiateSessionException
UniversalBody
receiveRequest
in interface UniversalBody
request
- the request to process
java.io.IOException
- if the request cannot be accepted
RenegotiateSessionException
public int receiveReply(Reply reply) throws java.io.IOException
UniversalBody
receiveReply
in interface UniversalBody
reply
- the reply received
java.io.IOException
- if the reply cannot be acceptedpublic void enableAC()
UniversalBody
enableAC
in interface UniversalBody
public void disableAC()
UniversalBody
disableAC
in interface UniversalBody
public void renegociateSessionIfNeeded(long sID) throws java.io.IOException, RenegotiateSessionException, SecurityNotAvailableException
java.io.IOException
RenegotiateSessionException
SecurityNotAvailableException
public java.lang.String getVNName() throws java.io.IOException, SecurityNotAvailableException
getVNName
in interface UniversalBody
java.io.IOException
SecurityNotAvailableException
public void initiateSession(int type, UniversalBody body) throws java.io.IOException, CommunicationForbiddenException, AuthenticationException, RenegotiateSessionException, SecurityNotAvailableException
initiateSession
in interface UniversalBody
java.io.IOException
CommunicationForbiddenException
AuthenticationException
RenegotiateSessionException
SecurityNotAvailableException
public void terminateSession(long sessionID) throws java.io.IOException, SecurityNotAvailableException
terminateSession
in interface UniversalBody
java.io.IOException
SecurityNotAvailableException
public java.security.cert.X509Certificate getCertificate() throws java.io.IOException, SecurityNotAvailableException
getCertificate
in interface UniversalBody
java.io.IOException
SecurityNotAvailableException
public ProActiveSecurityManager getProActiveSecurityManager() throws java.io.IOException, SecurityNotAvailableException
getProActiveSecurityManager
in interface UniversalBody
java.io.IOException
SecurityNotAvailableException
public ProActiveSPMDGroupManager getProActiveSPMDGroupManager()
public Policy getPolicyFrom(java.security.cert.X509Certificate certificate) throws java.io.IOException, SecurityNotAvailableException
getPolicyFrom
in interface UniversalBody
java.io.IOException
SecurityNotAvailableException
public long startNewSession(Communication policy) throws java.io.IOException, RenegotiateSessionException, SecurityNotAvailableException
startNewSession
in interface UniversalBody
java.io.IOException
RenegotiateSessionException
SecurityNotAvailableException
public ConfidentialityTicket negociateKeyReceiverSide(ConfidentialityTicket confidentialityTicket, long sessionID) throws java.io.IOException, KeyExchangeException, SecurityNotAvailableException
negociateKeyReceiverSide
in interface UniversalBody
java.io.IOException
KeyExchangeException
SecurityNotAvailableException
public java.security.PublicKey getPublicKey() throws java.io.IOException, SecurityNotAvailableException
getPublicKey
in interface UniversalBody
java.io.IOException
SecurityNotAvailableException
public byte[] randomValue(long sessionID, byte[] cl_rand) throws java.io.IOException, SecurityNotAvailableException, java.lang.Exception
randomValue
in interface UniversalBody
java.io.IOException
SecurityNotAvailableException
java.lang.Exception
public byte[][] publicKeyExchange(long sessionID, UniversalBody distantBody, byte[] my_pub, byte[] my_cert, byte[] sig_code) throws java.io.IOException, SecurityNotAvailableException, java.lang.Exception
publicKeyExchange
in interface UniversalBody
java.io.IOException
SecurityNotAvailableException
java.lang.Exception
public byte[][] secretKeyExchange(long sessionID, byte[] tmp, byte[] tmp1, byte[] tmp2, byte[] tmp3, byte[] tmp4) throws java.io.IOException, java.lang.Exception, SecurityNotAvailableException
secretKeyExchange
in interface UniversalBody
java.io.IOException
java.lang.Exception
SecurityNotAvailableException
public Communication getPolicyTo(java.lang.String type, java.lang.String from, java.lang.String to) throws SecurityNotAvailableException, java.io.IOException
getPolicyTo
in interface UniversalBody
SecurityNotAvailableException
java.io.IOException
public SecurityContext getPolicy(SecurityContext securityContext) throws java.io.IOException, SecurityNotAvailableException
getPolicy
in interface UniversalBody
java.io.IOException
SecurityNotAvailableException
public byte[] getCertificateEncoded() throws java.io.IOException, SecurityNotAvailableException
getCertificateEncoded
in interface UniversalBody
java.io.IOException
SecurityNotAvailableException
protected void startDefaultProActiveSecurityManager()
public java.util.ArrayList getEntities() throws SecurityNotAvailableException, java.io.IOException
getEntities
in interface UniversalBody
SecurityNotAvailableException
java.io.IOException
public void terminate()
UniversalBody
terminate
in interface UniversalBody
public void blockCommunication()
Body
blockCommunication
in interface Body
public void acceptCommunication()
Body
acceptCommunication
in interface Body
public void enterInThreadStore()
Body
enterInThreadStore
in interface Body
public void exitFromThreadStore()
Body
exitFromThreadStore
in interface Body
public boolean isAlive()
Body
isAlive
in interface Body
public boolean isActive()
Body
isActive
in interface Body
public UniversalBody checkNewLocation(UniqueID bodyID)
Body
checkNewLocation
in interface Body
bodyID
- the id of the body to lookup
public void setPolicyServer(PolicyServer server)
Body
setPolicyServer
in interface Body
server
- the policy serverpublic FuturePool getFuturePool()
LocalBodyStrategy
getFuturePool
in interface LocalBodyStrategy
public BlockingRequestQueue getRequestQueue()
LocalBodyStrategy
getRequestQueue
in interface LocalBodyStrategy
public java.lang.Object getReifiedObject()
LocalBodyStrategy
getReifiedObject
in interface LocalBodyStrategy
public java.lang.String getName()
LocalBodyStrategy
getName
in interface LocalBodyStrategy
public void serve(Request request)
serve
in interface LocalBodyStrategy
request
- the request to servepublic void sendRequest(MethodCall methodCall, Future future, UniversalBody destinationBody) throws java.io.IOException, RenegotiateSessionException
LocalBodyStrategy
request
with the future future
to the local body
body
.
sendRequest
in interface LocalBodyStrategy
methodCall
- the methodCall to sendfuture
- the future associated to the requestdestinationBody
- the body the request is sent to
java.io.IOException
- if the request cannot be sent to the destination body
RenegotiateSessionException
public java.lang.String getHandlerizableInfo() throws java.io.IOException
getHandlerizableInfo
in interface Handlerizable
java.io.IOException
public java.util.HashMap getHandlersLevel() throws java.io.IOException
getHandlersLevel
in interface Handlerizable
java.io.IOException
public void clearHandlersLevel() throws java.io.IOException
clearHandlersLevel
in interface Handlerizable
java.io.IOException
public void setExceptionHandler(Handler handler, java.lang.Class exception) throws java.io.IOException
setExceptionHandler
in interface Handlerizable
handler
- A handler associated with a class of non functional exception.exception
- A class of non functional exception. It is a subclass of NonFunctionalException
.
java.io.IOException
public Handler unsetExceptionHandler(java.lang.Class exception) throws java.io.IOException
unsetExceptionHandler
in interface Handlerizable
exception
- A class of non functional exception. It is a subclass of NonFunctionalException
.
java.io.IOException
public int receiveFTMessage(FTMessage fte)
UniversalBody
receiveFTMessage
in interface UniversalBody
fte
- the message to send
protected abstract int internalReceiveRequest(Request request) throws java.io.IOException, RenegotiateSessionException
request
- the request to process
java.io.IOException
- if the request cannot be accepted
RenegotiateSessionException
protected abstract int internalReceiveReply(Reply reply) throws java.io.IOException
reply
- the reply received
java.io.IOException
- if the reply cannot be acceptedprotected void setLocalBodyImpl(LocalBodyStrategy localBody)
protected void activityStopped()
protected void activityStarted()
public void setSPMDGroup(java.lang.Object o)
o
- - the new SPMD grouppublic java.lang.Object getSPMDGroup()
public int getSPMDGroupSize()
public FTManager getFTManager()
public void setFTManager(FTManager ftm)
ftm
- The ftm to set.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |