|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--prueba1.platform.Platform
Field Summary | |
AccessService |
AS
|
java.lang.String |
dnsServer
|
static int |
EXISTING
The newcomming platform when booting |
prueba1.hosting.HostingService |
HS
|
PlatformProxy |
myProxy
The Proxy that the agents have instead of having a PlatformObject |
static int |
NEW
The newcomming platform when booting |
prueba1.naming.NamingService |
NS
|
Constructor Summary | |
protected |
Platform(PlatformProxy _pp)
The constructor that just starts running the platform. |
Method Summary | |
void |
addAgent(Agent _agent)
This method adds the agent into the platform |
int |
addPlatform(java.lang.String _ip,
int _number)
This method adds a new platform to the vector so it is considered by this platform to be in the ring. |
void |
agentCreation(java.lang.String _agentClassName)
This method allows PlatformProxy to create an agent and add it, after the platform has been created |
void |
fillData(prueba1.transport.aux.PlatformMessage _pmsg,
int _type)
This method gets the data from the message and fills in the platform's vector and so.... |
java.lang.String |
getLocation(java.lang.String _agentName)
THis method gets the IP of the machine in which the agent passed as parameter is hosted. |
java.lang.String |
getMyIP()
This method returns the IP of this platform |
int |
getNumber()
This method retrieves the number of the platform |
java.util.Vector |
getPlatforms()
This method returns the Vector that have the platforms connected to the ring. |
Proxy |
getProxy(java.lang.String _agentName)
This method gets a proxy to an agent |
void |
messageReceived()
This method tells the platform when it has been received a BOOTMESSAGE and the platform (hopefully) has been accepted by the ring |
int |
nextPlatformToJoin()
This method checks the size of the Vector that holds the platforms and calculates which is gonna be the next number for the next platform |
void |
sendAgent(int _secs,
int _num,
java.lang.String _a,
int _p,
Agent _ag)
The service of the platform to send the agent. |
void |
sendCircularMessage(prueba1.transport.aux.PlatformMessage _pmsg)
This method sends a message to another platform when another one is booting |
void |
startup(java.lang.String _tutorPlatform)
This method in necessary for the platform to boot up. |
void |
stop()
This is the method that cleans up everything when the platform stops. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NEW
public static final int EXISTING
public java.lang.String dnsServer
public PlatformProxy myProxy
public prueba1.naming.NamingService NS
public prueba1.hosting.HostingService HS
public AccessService AS
Constructor Detail |
protected Platform(PlatformProxy _pp)
Method Detail |
public void startup(java.lang.String _tutorPlatform)
_tutorPlatform
- The platform, already being part of the ring, that is going to start the
message that will make the platform part of it also. In the case that the platform
is the first to join the ring the argument must be ""public void messageReceived()
public void sendAgent(int _secs, int _num, java.lang.String _a, int _p, Agent _ag)
_a
- address of the destination platform_p
- port of the destination platform listening to agents to go_ag
- the actual agent to be sentpublic void agentCreation(java.lang.String _agentClassName)
public void addAgent(Agent _agent)
public int nextPlatformToJoin()
public java.util.Vector getPlatforms()
public java.lang.String getMyIP()
public java.lang.String getLocation(java.lang.String _agentName)
public int getNumber()
public Proxy getProxy(java.lang.String _agentName)
public int addPlatform(java.lang.String _ip, int _number)
_number
- is only to check if it's the same as the position in which is
being addedpublic void sendCircularMessage(prueba1.transport.aux.PlatformMessage _pmsg)
public void fillData(prueba1.transport.aux.PlatformMessage _pmsg, int _type)
public void stop()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |