|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jppf.server.protocol.AbstractLocation<T>
T - the type of this location.public abstract class AbstractLocation<T>
Instances of this class represent the location of an artifact, generally a file or the data found at a url.
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
AbstractLocation(T path)
Initialize this location with the specified type and path. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jppf.server.protocol.Location |
|---|
getInputStream, getOutputStream, size |
| Field Detail |
|---|
protected T path
protected List<LocationEventListener> listeners
protected boolean eventsEnabled
| Constructor Detail |
|---|
public AbstractLocation(T path)
path - the path for this location.| Method Detail |
|---|
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.
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||