|
P-Grid v2.0a2 API Specification | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectp2p.basic.P2PFactory
public abstract class P2PFactory
Abstract Factory (GoF) that defines the operations that create various objects of the P2P layer. It is recommended to instantiate such types only through a concrete implementation of this factory to avoid hard-coding direct references to them. This class provides static methods to find concrete factories using the reflection API to further decouple the subsystem from its client.
| Constructor Summary | |
|---|---|
P2PFactory()
|
|
| Method Summary | |
|---|---|
abstract Message |
createMessage(byte[] contents)
Create a Message instance compatible with the P2P implementation. |
abstract P2P |
createP2P(Properties properties)
Create the concrete P2P implementation. |
abstract Peer |
createPeer(InetAddress netAddr,
int port)
Create a Peer instance compatible with the P2P implementation based on the provided information. |
abstract GUID |
generateGUID()
Generate a GUID instance compatible with the P2P implementation. |
abstract Key |
generateKey(Object obj)
Generate a Key instance compatible with the P2P implementation. |
abstract KeyRange |
generateKeyRange(Object lowerBound,
Object higherBound)
Generate a KeyRange instance compatible with the P2P implementation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public P2PFactory()
| Method Detail |
|---|
public abstract P2P createP2P(Properties properties)
public abstract Key generateKey(Object obj)
obj - the source object from which to generate the key
public abstract KeyRange generateKeyRange(Object lowerBound,
Object higherBound)
lowerBound - the source object from which to generate the lower keylowerBound - the source object from which to generate the higher key
public abstract GUID generateGUID()
public abstract Message createMessage(byte[] contents)
contents - the binary content to include in the message
public abstract Peer createPeer(InetAddress netAddr,
int port)
throws UnknownHostException
netAddr - the Internet address of the peerport - the service port number of the peer
UnknownHostException - if the given address is invalid.
|
P-Grid v2.0a2 API Specification | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||