T - the type of this location.public abstract class AbstractLocation<T> extends Object implements Serializable, Location<T>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
eventsEnabled
Boolean flag that determines if at least one listener is registered.
|
protected List<LocationEventListener> |
listeners
The list of listeners to this location.
|
protected T |
path
The path for this location.
|
| Constructor and Description |
|---|
AbstractLocation(T path)
Initialize this location with the specified type and path.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addLocationEventListener(LocationEventListener listener)
Add a listener to the list of location event listeners for this location.
|
void |
copyTo(Location location)
Copy the content at this location to another location.
|
protected void |
fireLocationEvent(int n)
Notify all listeners that a data transfer has occurred.
|
T |
getPath()
Return the path to this location.
|
void |
removeLocationEventListener(LocationEventListener listener)
Remove a listener from the list of location event listeners for this location.
|
byte[] |
toByteArray()
Get the content at this location as an array of bytes.
|
String |
toString()
Get a string representation of this location.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetInputStream, getOutputStream, sizeprotected T path
protected List<LocationEventListener> listeners
protected boolean eventsEnabled
public AbstractLocation(T path)
path - the path for this location.public T getPath()
getPath in interface Location<T>Location.getPath()public void copyTo(Location location) throws Exception
copyTo in interface Location<T>location - the location to copy to.Exception - if an I/O error occurs.Location.copyTo(org.jppf.server.protocol.Location)public byte[] toByteArray()
throws Exception
toByteArray in interface Location<T>Exception - if an I/O error occurs.Location.toByteArray()public String toString()
toString in class ObjectObject.toString()public void addLocationEventListener(LocationEventListener listener)
addLocationEventListener in interface Location<T>listener - the listener to add to the list.NullPointerException - if the listener object is null.Location.addLocationEventListener(org.jppf.server.protocol.LocationEventListener)public void removeLocationEventListener(LocationEventListener listener)
removeLocationEventListener in interface Location<T>listener - the listener to remove from the list.NullPointerException - if the listener object is null.Location.removeLocationEventListener(org.jppf.server.protocol.LocationEventListener)protected void fireLocationEvent(int n)
n - - the size of the data that was transferred.Copyright © 2005-2012 JPPF Team.