|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.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 InternalBodySecurity |
internalBodySecurity
|
protected boolean |
isSecurityOn
|
protected LocalBodyStrategy |
localBodyStrategy
|
protected static org.apache.log4j.Logger |
logger
|
protected java.util.Hashtable |
openedSessions
|
protected ProActiveGroupManager |
pgm
|
protected ProActiveSecurityManager |
psm
|
protected ThreadStore |
threadStore
|
Fields inherited from class org.objectweb.proactive.core.body.AbstractUniversalBody |
bodyID, location, nodeURL, remoteBody, remoteBodyFactory |
Constructor Summary | |
AbstractBody()
Creates a new AbstractBody. |
|
AbstractBody(java.lang.Object reifiedObject,
java.lang.String nodeURL,
MetaObjectFactory factory)
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()
|
byte[] |
getCertificateEncoded()
|
java.util.ArrayList |
getEntities()
|
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)
|
Policy |
getPolicyFrom(java.security.cert.X509Certificate certificate)
|
Communication |
getPolicyTo(java.lang.String type,
java.lang.String from,
java.lang.String to)
|
ProActiveSecurityManager |
getProActiveSecurityManager()
|
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 |
java.lang.String |
getVNName()
|
void |
initiateSession(int type,
UniversalBody body)
|
protected abstract void |
internalReceiveReply(Reply reply)
Receives a reply in response to a former request. |
protected abstract void |
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)
|
void |
receiveReply(Reply reply)
Receives a reply in response to a former request. |
void |
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. |
protected void |
setLocalBodyImpl(LocalBodyStrategy localBody)
|
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)
|
void |
test()
|
java.lang.String |
toString()
Returns a string representation of this object. |
Methods inherited from class org.objectweb.proactive.core.body.AbstractUniversalBody |
getID, 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.core.body.UniversalBody |
getID, getNodeURL, getRemoteAdapter, setImmediateService, updateLocation |
Methods inherited from interface org.objectweb.proactive.core.body.message.MessageEventProducer |
addMessageEventListener, removeMessageEventListener |
Methods inherited from interface org.objectweb.proactive.Job |
getJobID |
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 ProActiveGroupManager pgm
Constructor Detail |
public AbstractBody()
public AbstractBody(java.lang.Object reifiedObject, java.lang.String nodeURL, MetaObjectFactory factory)
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()
toString
in class java.lang.Object
public void 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 void receiveReply(Reply reply) throws java.io.IOException
UniversalBody
receiveReply
in interface UniversalBody
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 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()
Body
terminate
in interface Body
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 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
protected abstract void 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 void 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 void test()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |