BufferedReader br = new BufferedReader(ipsr);
while ((adr = br.readLine()) != null) {
- liste.add(new SuperNodeData(adr, 1098));
+ liste.add(new SuperNodeData(adr, 1099));
}
br.close();
// String adr3="193.52.61.140";
// System.out.println("adr3 = " + adr3);
- // liste.add(new SuperNodeData(adr1, 1098));
- // liste.add(new SuperNodeData(adr2, 1098));
- // liste.add(new SuperNodeData(adr3, 1098));
+ // liste.add(new SuperNodeData(adr1, 1099));
+ // liste.add(new SuperNodeData(adr2, 1099));
+ // liste.add(new SuperNodeData(adr3, 1099));
}
public void fileInitialization(String fileName) {
/*********** Sébastien Miquée ***********/
/****************************************/
- public void addGNode( GNode _g )
+ public synchronized void addGNode( GNode _g )
{
if( _g != null )
{
}
}
- public void removeGNode( GNode _g, int _mode, String _spawnerIP )
+ public synchronized void removeGNode( GNode _g, int _mode, String _spawnerIP )
{
if( _g != null )
{
}
}
+ public synchronized void removeGNode( GNode _g, int _mode )
+ {
+ if( _g != null )
+ {
+
+ SuperNodeData d = null ;
+ JaceSuperNodeInterface remoteStub = null ;
+
+ for( int i = 0 ; i < liste.size() ; i++ )
+ {
+ d = (SuperNodeData) liste.elementAt( i ) ;
+ if( ! d.getIP().equals(LocalHost.Instance().getIP() ) )
+ {
+ // if not me, I inform the other super nodes
+ remoteStub = d.getStub() ;
+ try {
+ remoteStub.removeMappedGNode( _g, _mode ) ;
+ } catch( Exception e ) {
+ System.err.println( "Unable to remove GNode on SuperNode " + d.getIP() ) ;
+ }
+ }
+ }
+ }
+ }
+
+ public synchronized void setMappedGNode( GNode _g, int _mode )
+ {
+ if( _g != null )
+ {
+
+ SuperNodeData d = null ;
+ JaceSuperNodeInterface remoteStub = null ;
+
+ for( int i = 0 ; i < liste.size() ; i++ )
+ {
+ d = (SuperNodeData) liste.elementAt( i ) ;
+ if( ! d.getIP().equals(LocalHost.Instance().getIP() ) )
+ {
+ // if not me, I inform the other super nodes
+ remoteStub = d.getStub() ;
+ try {
+ remoteStub.setMapped( _g, _mode ) ;
+ } catch( Exception e ) {
+ System.err.println( "Unable to set mapped GNode on SuperNode " + d.getIP() ) ;
+ }
+ }
+ }
+ }
+ }
+
protected boolean workingOnGnodes()
{
}
}
- public void propagateReplaceNode( GNode _dead, GNode _remp, String _spawnerIP )
+ public synchronized void propagateReplaceNode( GNode _dead, GNode _remp, String _spawnerIP )
{
if( _dead != null && _remp != null )
{