rice.pastry.socket
Class SocketNodeHandleFactory
java.lang.Object
rice.pastry.socket.SocketNodeHandleFactory
- All Implemented Interfaces:
- Serializer<SocketNodeHandle>, NodeHandleFactory<SocketNodeHandle>
- Direct Known Subclasses:
- RendezvousSNHFactory
public class SocketNodeHandleFactory
- extends java.lang.Object
- implements NodeHandleFactory<SocketNodeHandle>, Serializer<SocketNodeHandle>
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
pn
protected PastryNode pn
handleSet
protected java.util.Map<SocketNodeHandle,SocketNodeHandle> handleSet
listeners
protected java.util.Collection<NodeHandleFactoryListener<SocketNodeHandle>> listeners
SocketNodeHandleFactory
public SocketNodeHandleFactory(PastryNode pn)
getNodeHandle
public SocketNodeHandle getNodeHandle(MultiInetSocketAddress i,
long epoch,
Id id)
- This is kind of weird, may need to rethink this. This is called to build one w/o
deserializing anything. (Either the local node, or one with a bogus id).
- Parameters:
i
- id
-
- Returns:
readNodeHandle
public SocketNodeHandle readNodeHandle(InputBuffer buf)
throws java.io.IOException
- Specified by:
readNodeHandle
in interface NodeHandleFactory<SocketNodeHandle>
- Throws:
java.io.IOException
coalesce
public SocketNodeHandle coalesce(SocketNodeHandle h)
- Description copied from interface:
NodeHandleFactory
- Needed for legacy java deserialization of NodeHanlde because we aren't given any
other way to do this properly such as a protected constructor.
- Specified by:
coalesce
in interface NodeHandleFactory<SocketNodeHandle>
- Returns:
notifyListeners
protected void notifyListeners(SocketNodeHandle nh)
- Notify the listeners that this new handle has come along.
addNodeHandleFactoryListener
public void addNodeHandleFactoryListener(NodeHandleFactoryListener<SocketNodeHandle> listener)
- Specified by:
addNodeHandleFactoryListener
in interface NodeHandleFactory<SocketNodeHandle>
removeNodeHandleFactoryListener
public void removeNodeHandleFactoryListener(NodeHandleFactoryListener<SocketNodeHandle> listener)
- Specified by:
removeNodeHandleFactoryListener
in interface NodeHandleFactory<SocketNodeHandle>
deserialize
public SocketNodeHandle deserialize(InputBuffer buf)
throws java.io.IOException
- Specified by:
deserialize
in interface Serializer<SocketNodeHandle>
- Throws:
java.io.IOException
serialize
public void serialize(SocketNodeHandle i,
OutputBuffer buf)
throws java.io.IOException
- Specified by:
serialize
in interface Serializer<SocketNodeHandle>
- Throws:
java.io.IOException
Copyright © 2001-2005 - Rice Pastry.