prueba1.access
Class AccessService
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--prueba1.access.AccessService
- All Implemented Interfaces:
- AccessServiceInterface, java.rmi.Remote, java.io.Serializable
- public class AccessService
- extends java.rmi.server.UnicastRemoteObject
- implements AccessServiceInterface
This class implements the access service that is in charge of providing access to any
agent from any other of the platform
- See Also:
- Serialized Form
Fields inherited from class java.rmi.server.RemoteObject |
ref |
Method Summary |
void |
createNotifier(java.lang.String _notifee,
java.lang.String _agentName)
This method is the one that creates a notifier that will tell the
platform that creates it, the events that happen to the agent
that is being followed. |
void |
destroyNotifier(java.lang.String _agentName)
This method destroys a Notifier already created. |
Proxy |
getProxy(java.lang.String _agentName)
This method returns a proxy to the caller. |
java.lang.Object |
invokeRemoteMethod(java.lang.String _agentName,
java.lang.String _methodName,
java.lang.Object[] _args)
This method invokes a method of the agent from the proxy (what means that is
from another agent that has a reference to him). |
int |
notifyArrival(java.lang.String _agentName)
This method is in charge of telling the notifier that an agent has just arrived |
int |
notifyMovement(java.lang.String _agentName,
java.lang.String _destination)
This method is in charge of sending the Notifier to the other platform to allow
this platform to know when does the agent get there and thus get the ref with
notifyArrival(). |
void |
notifyRemoteArrival(java.lang.String _agentName,
java.lang.String _newLocation)
This method carries out the work of put in contact the remote agent
and the proxy. |
int |
notifyRemoteMovement(java.lang.String _agentName,
java.lang.String _newLocation)
This method warns the service that an agent is going to move |
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 |
AccessService
public AccessService(Platform _plat)
throws java.rmi.RemoteException
- This method creates the service
notifyArrival
public int notifyArrival(java.lang.String _agentName)
- This method is in charge of telling the notifier that an agent has just arrived
notifyMovement
public int notifyMovement(java.lang.String _agentName,
java.lang.String _destination)
- This method is in charge of sending the Notifier to the other platform to allow
this platform to know when does the agent get there and thus get the ref with
notifyArrival().
This method is invoked by Notifier class.
getProxy
public Proxy getProxy(java.lang.String _agentName)
- This method returns a proxy to the caller. A proxy will never lose the reference to the
agent it point to, so what the caller get is a permanent reference.
notifyRemoteMovement
public int notifyRemoteMovement(java.lang.String _agentName,
java.lang.String _newLocation)
throws java.rmi.RemoteException
- This method warns the service that an agent is going to move
- Specified by:
notifyRemoteMovement
in interface AccessServiceInterface
notifyRemoteArrival
public void notifyRemoteArrival(java.lang.String _agentName,
java.lang.String _newLocation)
throws java.rmi.RemoteException
- This method carries out the work of put in contact the remote agent
and the proxy.
- Specified by:
notifyRemoteArrival
in interface AccessServiceInterface
createNotifier
public void createNotifier(java.lang.String _notifee,
java.lang.String _agentName)
throws java.rmi.RemoteException
- This method is the one that creates a notifier that will tell the
platform that creates it, the events that happen to the agent
that is being followed.
- Specified by:
createNotifier
in interface AccessServiceInterface
destroyNotifier
public void destroyNotifier(java.lang.String _agentName)
throws java.rmi.RemoteException
- This method destroys a Notifier already created.
- Specified by:
destroyNotifier
in interface AccessServiceInterface
invokeRemoteMethod
public java.lang.Object invokeRemoteMethod(java.lang.String _agentName,
java.lang.String _methodName,
java.lang.Object[] _args)
throws java.rmi.RemoteException
- This method invokes a method of the agent from the proxy (what means that is
from another agent that has a reference to him).
- Specified by:
invokeRemoteMethod
in interface AccessServiceInterface