View Javadoc

1   
2   package org.neo.swarm.services.jxta;
3   
4   import net.jxta.document.AdvertisementFactory;
5   import net.jxta.exception.PeerGroupException;
6   import net.jxta.peergroup.PeerGroup;
7   import net.jxta.peergroup.PeerGroupFactory;
8   import net.jxta.protocol.PipeAdvertisement;
9   
10  import org.neo.swarm.services.Service;
11  
12  
13  /***
14   * 
15   * @author navery
16   */
17  public class JxtaService implements Service {
18  
19  	protected PeerGroup netPeerGroup;
20      protected PipeAdvertisement pipeAdv;
21      private static final String JXTASERVICE = "SWARM_JXTAService";
22  
23  	public String getName() {
24  		return JXTASERVICE;
25  	}
26  
27  	public void start() {
28  		try {
29  		netPeerGroup = PeerGroupFactory.newNetPeerGroup();		
30  		pipeAdv = (PipeAdvertisement) AdvertisementFactory.newAdvertisement(getName());
31  		} catch (PeerGroupException ex) {
32  			ex.printStackTrace();
33  		}
34  
35  	}
36  
37  	public void stop() {
38  		// TODO Auto-generated method stub
39  
40  	}
41  
42  }