|
|||||||||||
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 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, shortcuts |
Fields inherited from interface org.objectweb.proactive.core.body.UniversalBody |
bodyLogger |
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 |
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()
entity certificate |
byte[] |
getCertificateEncoded()
Entity's X509Certificate as byte array |
java.util.ArrayList |
getEntities()
Retrieves all the entity's ID which contain this entity plus this entity ID. |
FTManager |
getFTManager()
To get the FTManager of this body |
FuturePool |
getFuturePool()
Returns the future pool of this body |
java.lang.String |
getName()
Returns the name of this body that can be used for displaying information |
SecurityContext |
getPolicy(SecurityContext securityContext)
Ask the entity to fill the securityContext parameters with its own policy according to the communication details contained in the given securityContext |
ProActiveSecurityManager |
getProActiveSecurityManager()
|
ProActiveSPMDGroupManager |
getProActiveSPMDGroupManager()
|
java.security.PublicKey |
getPublicKey()
entity public key |
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 |
UniversalBody |
getShortcutTargetBody(FunctionalInterfaceID functionalItfID)
Returns the body that is the target of this shortcut for this component interface |
java.lang.Object |
getSPMDGroup()
Returns the SPMD group of the active object |
int |
getSPMDGroupSize()
Returns the size of of the SPMD group |
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. |
byte[][] |
publicKeyExchange(long sessionID,
byte[] myPublicKey,
byte[] myCertificate,
byte[] signature)
exchange entity certificate and/or public key if certificate are not available |
byte[] |
randomValue(long sessionID,
byte[] clientRandomValue)
Exchange random value between client and server entity |
java.lang.Object |
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 |
registerIncomingFutures()
This method effectively register futures (ie in the futurePool) that arrive in this active object (by parameter or by result). |
void |
renegociateSessionIfNeeded(long sID)
|
byte[][] |
secretKeyExchange(long sessionID,
byte[] encodedAESKey,
byte[] encodedIVParameters,
byte[] encodedClientMacKey,
byte[] encodedLockData,
byte[] parametersSignature)
this method sends encoded secret parameters to the target entity |
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 |
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)
start an unvalidated empty session |
void |
terminate()
Terminate the body. |
void |
terminateSession(long sessionID)
terminate a given session |
java.lang.String |
toString()
Returns a string representation of this object. |
Methods inherited from class org.objectweb.proactive.core.body.AbstractUniversalBody |
addNFEListener, createShortcut, fireNFE, getID, getJobID, getNodeURL, getRemoteAdapter, removeNFEListener, 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 |
createShortcut, getID, getNodeURL, getRemoteAdapter, removeImmediateService, setImmediateService, setImmediateService, updateLocation |
Methods inherited from interface org.objectweb.proactive.core.exceptions.manager.NFEProducer |
addNFEListener, fireNFE, removeNFEListener |
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 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 registerIncomingFutures()
public void enableAC()
UniversalBody
enableAC
in interface UniversalBody
public void disableAC()
UniversalBody
disableAC
in interface UniversalBody
public void renegociateSessionIfNeeded(long sID) throws RenegotiateSessionException, SecurityNotAvailableException, java.io.IOException
RenegotiateSessionException
SecurityNotAvailableException
java.io.IOException
public void terminateSession(long sessionID) throws SecurityNotAvailableException, java.io.IOException
SecurityEntity
terminateSession
in interface SecurityEntity
sessionID
-
SecurityNotAvailableException
- id security is not available
java.io.IOException
public java.security.cert.X509Certificate getCertificate() throws SecurityNotAvailableException, java.io.IOException
SecurityEntity
getCertificate
in interface SecurityEntity
java.io.IOException
- if communication fails
SecurityNotAvailableException
- if security is not availablepublic ProActiveSecurityManager getProActiveSecurityManager() throws java.io.IOException, SecurityNotAvailableException
java.io.IOException
SecurityNotAvailableException
public ProActiveSPMDGroupManager getProActiveSPMDGroupManager()
public long startNewSession(Communication policy) throws RenegotiateSessionException, SecurityNotAvailableException, java.io.IOException
SecurityEntity
startNewSession
in interface SecurityEntity
policy
- policy associated to the session
RenegotiateSessionException
- if the session immediatly expires
SecurityNotAvailableException
- if security is not available
java.io.IOException
public java.security.PublicKey getPublicKey() throws SecurityNotAvailableException, java.io.IOException
SecurityEntity
getPublicKey
in interface SecurityEntity
SecurityNotAvailableException
java.io.IOException
public byte[] randomValue(long sessionID, byte[] clientRandomValue) throws SecurityNotAvailableException, RenegotiateSessionException, java.io.IOException
SecurityEntity
randomValue
in interface SecurityEntity
sessionID
- the session IDclientRandomValue
- client random value
RenegotiateSessionException
- if the session has expired
SecurityNotAvailableException
- if the security is not available
java.io.IOException
public byte[][] publicKeyExchange(long sessionID, byte[] myPublicKey, byte[] myCertificate, byte[] signature) throws SecurityNotAvailableException, RenegotiateSessionException, KeyExchangeException, java.io.IOException
SecurityEntity
publicKeyExchange
in interface SecurityEntity
sessionID
- the session IDmyPublicKey
- encoded public keymyCertificate
- encoded certificatesignature
- encoded signature of previous paramaters
SecurityNotAvailableException
- if the security is not available
KeyExchangeException
- if a key data/length/algorithm is not supported
RenegotiateSessionException
- if the session has expired
java.io.IOException
public byte[][] secretKeyExchange(long sessionID, byte[] encodedAESKey, byte[] encodedIVParameters, byte[] encodedClientMacKey, byte[] encodedLockData, byte[] parametersSignature) throws SecurityNotAvailableException, RenegotiateSessionException, java.io.IOException
SecurityEntity
secretKeyExchange
in interface SecurityEntity
sessionID
- session IDencodedAESKey
- the AES key use to exchange secret messageencodedIVParameters
- Initilization parameters for the AES keyencodedClientMacKey
- MAC key for checking signature of future messagesencodedLockData
- random value to prevent message replays by an external attackerparametersSignature
- encoded signature of the previous parameters
java.io.IOException
- if communication fails
RenegotiateSessionException
- if the session has expired or has been cancelled during this exchange
SecurityNotAvailableException
- if this entity does not support securitypublic SecurityContext getPolicy(SecurityContext securityContext) throws SecurityNotAvailableException, java.io.IOException
SecurityEntity
getPolicy
in interface SecurityEntity
securityContext
- communication details allowing the entity to
look for a matching policy
SecurityNotAvailableException
- thrown the entity doest not support the security
java.io.IOException
public byte[] getCertificateEncoded() throws SecurityNotAvailableException, java.io.IOException
SecurityEntity
getCertificateEncoded
in interface SecurityEntity
SecurityNotAvailableException
java.io.IOException
protected void startDefaultProActiveSecurityManager()
public java.util.ArrayList getEntities() throws SecurityNotAvailableException, java.io.IOException
SecurityEntity
getEntities
in interface SecurityEntity
SecurityNotAvailableException
- if the target entity does not support security
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 UniversalBody getShortcutTargetBody(FunctionalInterfaceID functionalItfID)
Body
getShortcutTargetBody
in interface Body
functionalItfID
- the id of the interface on which the shortcut is available
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.Object 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 |