net.tomp2p.simgrid
Class SimGridTomP2P

java.lang.Object
  extended by net.tomp2p.simgrid.SimGridTomP2P

public class SimGridTomP2P
extends Object

This the bridge for TomP2P to SimGrid. To make it start, one has to call:

 SimGridTomP2P.checkArgs(args);
 SimGridTomP2P.setSimulation(new Simulation(...));
 SimGridTomP2P.main(args);
 

Author:
Thomas Bocek

Constructor Summary
SimGridTomP2P()
           
 
Method Summary
static void addQueue(net.tomp2p.peers.Number160 senderID, SendingMessage sendingMessage)
           
static void checkArgs(String[] args)
           
static net.tomp2p.peers.PeerAddress createPeer(String peerID)
          Sometimes we need to create a PeerAddress.
static net.tomp2p.futures.FutureResponse getAndRemoveFuture(net.tomp2p.message.MessageID messageID)
           
static net.tomp2p.p2p.Peer getPeer(net.tomp2p.peers.Number160 peerID)
          Returns the static peers created here.
static SendingMessage getPendingMessag(net.tomp2p.peers.Number160 senderID)
           
static Simulation getSimulation()
           
static void main(String[] args)
          Initialize the simulation.
static void notify(net.tomp2p.peers.Number160 host)
           
static void send(String type, net.tomp2p.message.Message message, net.tomp2p.futures.FutureResponse futureResponse)
          SimGrid style of sending a message
static void setSimulation(Simulation simulation2)
           
static void wait(net.tomp2p.peers.Number160 host, org.simgrid.msg.Process process)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimGridTomP2P

public SimGridTomP2P()
Method Detail

getPeer

public static net.tomp2p.p2p.Peer getPeer(net.tomp2p.peers.Number160 peerID)
Returns the static peers created here. We need to get them in a static context since the SimGrid threads may die.

Parameters:
peerID - The peerID
Returns:
The peer with the peerID

createPeer

public static net.tomp2p.peers.PeerAddress createPeer(String peerID)
Sometimes we need to create a PeerAddress.

Parameters:
peerID - The peerID
Returns:
The peerAddress

send

public static void send(String type,
                        net.tomp2p.message.Message message,
                        net.tomp2p.futures.FutureResponse futureResponse)
                 throws org.simgrid.msg.NativeException,
                        org.simgrid.msg.TransferFailureException,
                        org.simgrid.msg.HostFailureException,
                        org.simgrid.msg.TimeoutException
SimGrid style of sending a message

Parameters:
type - The message type
message - The TomP2P message
futureResponse -
Throws:
org.simgrid.msg.NativeException
org.simgrid.msg.TimeoutException
org.simgrid.msg.HostFailureException
org.simgrid.msg.TransferFailureException

getAndRemoveFuture

public static net.tomp2p.futures.FutureResponse getAndRemoveFuture(net.tomp2p.message.MessageID messageID)

addQueue

public static void addQueue(net.tomp2p.peers.Number160 senderID,
                            SendingMessage sendingMessage)

getPendingMessag

public static SendingMessage getPendingMessag(net.tomp2p.peers.Number160 senderID)
                                       throws InterruptedException
Throws:
InterruptedException

wait

public static void wait(net.tomp2p.peers.Number160 host,
                        org.simgrid.msg.Process process)

notify

public static void notify(net.tomp2p.peers.Number160 host)

setSimulation

public static void setSimulation(Simulation simulation2)

getSimulation

public static Simulation getSimulation()

checkArgs

public static void checkArgs(String[] args)

main

public static void main(String[] args)
                 throws IOException
Initialize the simulation.

Parameters:
args - Two arguments are required: the platform file and the deployment file
Throws:
IOException


Copyright © 2012. All Rights Reserved.