|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jlab.coda.et.SystemUse
This class implements an object which allows a user to interact with an ET system. It is not the ET system itself, but rather a proxy which communicates over the network with the real ET system.
| Field Summary | |
(package private) java.io.DataInputStream |
in
Data input stream built on top of the socket's input stream (with an intervening buffered input stream). |
(package private) java.io.DataOutputStream |
out
Data output stream built on top of the socket's output stream (with an intervening buffered output stream). |
| Constructor Summary | |
SystemUse(SystemOpenConfig _config)
Create a new SystemUse object. |
|
SystemUse(SystemOpenConfig _config,
int _debug)
Create a new SystemUse object. |
|
SystemUse(SystemOpen _sys,
int _debug)
Create a new SystemUse object. |
|
| Method Summary | |
boolean |
alive()
Is the ET system alive - still up and running? |
Attachment |
attach(Station station)
Create an attachment to a station. |
void |
close()
Close the ET system. |
Station |
createStation(StationConfig config,
java.lang.String name)
Creates a new station placed at the end of the linked list of stations. |
Station |
createStation(StationConfig config,
java.lang.String name,
int position)
Creates a new station at a specified position in the linked list of stations. |
Station |
createStation(StationConfig config,
java.lang.String name,
int position,
int parallelPosition)
Creates a new station at a specified position in the linked list of stations and in a specified position in a linked list of parallel stations if it is a parallel station. |
void |
detach(Attachment att)
Remove an attachment from a station. |
void |
dumpEvents(Attachment att,
Event[] evs)
Dispose of unwanted events in an ET system. |
void |
dumpEventsList(Attachment att,
java.util.List eventList)
Dispose of unwanted events in an ET system. |
int |
getAttachmentsMax()
Gets the maximum number of attachments allowed in the ET system. |
SystemOpenConfig |
getConfig()
Gets a copy of the configuration used to specify how to open the ET system. |
AllData |
getData()
Gets all information about the ET system. |
int |
getDebug()
Gets the debug output level. |
Event[] |
getEvents(Attachment att,
int mode,
int microSec,
int count)
Get events from an ET system. |
Event[] |
getEvents2(Attachment att,
int mode,
int microSec,
int count)
Get events from an ET system. |
int |
getEventSize()
Gets the "normal" event size in bytes. |
java.util.ArrayList |
getEventsList(Attachment att,
int mode,
int microSec,
int count)
Get events from an ET system. |
int |
getHeartbeat()
Gets the ET system heartbeat. |
int[] |
getHistogram()
Gets histogram containing data showing how many events in GRAND_CENTRAL's input list when new events are requested by users. |
java.lang.String |
getHost()
Gets the ET system's host name. |
int |
getLanguage()
Gets the ET system's implementation language. |
int |
getNumAttachments()
Gets the number of attachments in the ET system. |
int |
getNumEvents()
Gets the number of events in the ET system. |
int |
getNumProcesses()
Gets the number of local processes in the ET system. |
int |
getNumStations()
Gets the number of stations in the ET system. |
int |
getNumTemps()
Gets the number of temp events in the ET system. |
int |
getPid()
Gets the UNIX pid of the ET system process. |
int |
getProcessesMax()
Gets the maximum number of local processes allowed in the ET system. |
int |
getStationParallelPosition(Station station)
Gets the position of a parallel station in its linked list of parallel stations. |
int |
getStationPosition(Station station)
Gets the position of a station in the linked list of stations. |
int |
getStationsMax()
Gets the maximum number of stations allowed in the ET system. |
int |
getTcpPort()
Gets the tcp server port number. |
int |
getTempsMax()
Gets the maximum number of temp events allowed in the ET system. |
Event[] |
newEvents(Attachment att,
int mode,
int microSec,
int count,
int size)
Get new or unused events from an ET system. |
java.util.ArrayList |
newEventsList(Attachment att,
int mode,
int microSec,
int count,
int size)
Get new or unused events from an ET system. |
void |
putEvents(Attachment att,
Event[] evs)
Put events into an ET system. |
void |
putEvents2(Attachment att,
Event[] evs)
Put events into an ET system. |
void |
putEventsList(Attachment att,
java.util.List eventList)
Put events into an ET system. |
void |
removeStation(Station station)
Removes an existing station. |
void |
setDebug(int val)
Sets the debug output level. |
void |
setStationPosition(Station station,
int position,
int parallelPosition)
Changes the position of a station in the linked list of stations. |
boolean |
stationAttached(Station station,
Attachment att)
Tells if an attachment is attached to a station. |
boolean |
stationExists(java.lang.String name)
Tells if a station exists. |
Station |
stationNameToObject(java.lang.String name)
Gets a station's object representation from its name. |
void |
wakeUpAll(Station station)
Wake up all attachments waiting to read events from a station's empty input list. |
void |
wakeUpAttachment(Attachment att)
Wake up an attachment that is waiting to read events from a station's empty input list. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
java.io.DataInputStream in
java.io.DataOutputStream out
| Constructor Detail |
public SystemUse(SystemOpenConfig _config,
int _debug)
throws java.io.IOException,
java.net.UnknownHostException,
EtException,
EtTooManyException
_config - SystemOpenConfig object to specify how to open the ET
system of interest_debug - debug level (e.g. Constants.debugInfo)
java.io.IOException - if problems with network comunications
java.net.UnknownHostException - if the host address(es) is(are) unknown
EtException - if the responding ET system has the wrong name, runs a different
version of ET, or has a different value for
Constants.stationSelectInts
EtTooManyException - if there were more than one valid response when policy is set to
Constants.policyError and we are looking either
remotely or anywhere for the ET system.
public SystemUse(SystemOpenConfig _config)
throws java.io.IOException,
java.net.UnknownHostException,
EtException,
EtTooManyException
_config - SystemOpenConfig object to specify how to open the ET
system of interest
java.io.IOException - if problems with network comunications
java.net.UnknownHostException - if the host address(es) is(are) unknown
EtException - if the responding ET system has the wrong name, runs a different
version of ET, or has a different value for
Constants.stationSelectInts
EtTooManyException - if there were more than one valid response when policy is set to
Constants.policyError and we are looking either
remotely or anywhere for the ET system.
public SystemUse(SystemOpen _sys,
int _debug)
throws java.io.IOException,
java.net.UnknownHostException,
EtException,
EtTooManyException
_sys - SystemOpen object to specify a connection to the ET
system of interest_debug - debug level (e.g. Constants.debugInfo)
java.io.IOException - if problems with network comunications
java.net.UnknownHostException - if the host address(es) is(are) unknown
EtException - if the responding ET system has the wrong name, runs a different
version of ET, or has a different value for
Constants.stationSelectInts
EtTooManyException - if there were more than one valid response when policy is set to
Constants.policyError and we are looking either
remotely or anywhere for the ET system.| Method Detail |
public void close()
public boolean alive()
true if the ET system is alive, otherwise
false
public void wakeUpAttachment(Attachment att)
throws java.io.IOException,
EtException
att - attachment to wake up
java.io.IOException - if problems with network comunications
EtException - if the attachment object is invalid
public void wakeUpAll(Station station)
throws java.io.IOException,
EtException
java.io.IOException - if problems with network comunications
EtException - if the station object is invalid
public Station createStation(StationConfig config,
java.lang.String name)
throws java.io.IOException,
EtException,
EtExistsException,
EtTooManyException
config - station configurationname - station name
java.io.IOException - if problems with network comunications
EtException - if the select method's class cannot be loaded, the position is less
than 1 (GRAND_CENTRAL's spot), the name is GRAND_CENTRAL (already
taken), the configuration's cue size is too big, or the configuration
needs a select class name
EtExistsException - if the station already exists but with a different configuration
EtTooManyException - if the maximum number of stations has been created already
public Station createStation(StationConfig config,
java.lang.String name,
int position)
throws java.io.IOException,
EtException,
EtExistsException,
EtTooManyException
config - station configurationname - station name
java.io.IOException - if problems with network comunications
EtException - if the select method's class cannot be loaded, the position is less
than 1 (GRAND_CENTRAL's spot), the name is GRAND_CENTRAL (already
taken), the configuration's cue size is too big, or the configuration
needs a select class name
EtExistsException - if the station already exists but with a different configuration
EtTooManyException - if the maximum number of stations has been created already
public Station createStation(StationConfig config,
java.lang.String name,
int position,
int parallelPosition)
throws java.io.IOException,
EtException,
EtExistsException,
EtTooManyException
config - station configurationname - station nameposition - position in the linked list to put the station.
java.io.IOException - if problems with network comunications
EtException - if the select method's class cannot be loaded, the position is less
than 1 (GRAND_CENTRAL's spot), the name is GRAND_CENTRAL (already
taken), the configuration's cue size is too big, or the configuration
needs a select class name
EtExistsException - if the station already exists but with a different configuration
EtTooManyException - if the maximum number of stations has been created already
public void removeStation(Station station)
throws java.io.IOException,
EtException
station - station object
java.io.IOException - if problems with network comunications
EtException - if attachments to the station still exist, the station is GRAND_CENTRAL
(which must always exist), the station does not exist, or the
station object is invalid
public void setStationPosition(Station station,
int position,
int parallelPosition)
throws java.io.IOException,
EtException
station - station objectposition - position in the main linked list (starting at 0)
java.io.IOException - if problems with network comunications
EtException - if the station does not exist, trying to move GRAND_CENTRAL, position
is < 1 (GRAND_CENTRAL is always first), parallelPosition < 0,
station object is invalid,
trying to move an incompatible parallel station to an existing group
of parallel stations or to the head of an existing group of parallel
stations.
public int getStationPosition(Station station)
throws java.io.IOException,
EtException
station - station object
java.io.IOException - if problems with network comunications
EtException - if the station does not exist, or station object is invalid
public int getStationParallelPosition(Station station)
throws java.io.IOException,
EtException
station - station object
java.io.IOException - if problems with network comunications
EtException - if the station does not exist, or station object is invalid
public Attachment attach(Station station)
throws java.io.IOException,
EtException,
EtTooManyException
station - station object
java.io.IOException - if problems with network comunications
EtException - if the station does not exist, or station object is invalid
EtTooManyException - if no more attachments are allowed to the station, or
if no more attachments are allowed to ET system
public void detach(Attachment att)
throws java.io.IOException,
EtException
att - attachment object
java.io.IOException - if problems with network comunications
EtException - if the attachment object is invalid
public boolean stationAttached(Station station,
Attachment att)
throws java.io.IOException,
EtException
station - station objectatt - attachment object
true if an attachment is attached to a station
and false otherwise
java.io.IOException - if problems with network comunications
EtException - if the station does not exist, station object is invalid, or attachment
object is invalid
public boolean stationExists(java.lang.String name)
throws java.io.IOException
name - station name
true if a station exists and
false otherwise
java.io.IOException - if problems with network comunications
public Station stationNameToObject(java.lang.String name)
throws java.io.IOException,
EtException
name - station name
java.io.IOException - if problems with network comunications
EtException - if the station does not exist
public java.util.ArrayList newEventsList(Attachment att,
int mode,
int microSec,
int count,
int size)
throws java.io.IOException,
EtException,
EtEmptyException,
EtBusyException,
EtTimeoutException,
EtWakeUpException
att - attachment objectmode - if there are no events available, this parameter specifies
whether to wait for some by sleeping, by waiting for a set
time, or by returning immediatelymicroSec - the number of microseconds to wait if a timed wait is
specifiedcount - the number of events desiredsize - the size of events in bytes
java.io.IOException - if problems with network comunications
EtException - if arguments have bad values or attachment object is invalid
EtEmptyException - if the mode is asynchronous and the station's input list is empty
EtBusyException - if the mode is asynchronous and the station's input list is being used
(the mutex is locked)
EtTimeoutException - if the mode is timed wait and the time has expired
EtWakeUpException - if the attachment has been commanded to wakeup,
EventList.wakeUp(org.jlab.coda.et.AttachmentLocal), EventList.wakeUpAll()
public Event[] newEvents(Attachment att,
int mode,
int microSec,
int count,
int size)
throws java.io.IOException,
EtException,
EtEmptyException,
EtBusyException,
EtTimeoutException,
EtWakeUpException
att - attachment objectmode - if there are no events available, this parameter specifies
whether to wait for some by sleeping, by waiting for a set
time, or by returning immediatelymicroSec - the number of microseconds to wait if a timed wait is
specifiedcount - the number of events desiredsize - the size of events in bytes
java.io.IOException - if problems with network comunications
EtException - if arguments have bad values or attachment object is invalid
EtEmptyException - if the mode is asynchronous and the station's input list is empty
EtBusyException - if the mode is asynchronous and the station's input list is being used
(the mutex is locked)
EtTimeoutException - if the mode is timed wait and the time has expired
EtWakeUpException - if the attachment has been commanded to wakeup,
EventList.wakeUp(org.jlab.coda.et.AttachmentLocal), EventList.wakeUpAll()
public java.util.ArrayList getEventsList(Attachment att,
int mode,
int microSec,
int count)
throws java.io.IOException,
EtException,
EtEmptyException,
EtBusyException,
EtTimeoutException,
EtWakeUpException
att - attachment objectmode - if there are no events available, this parameter specifies
whether to wait for some by sleeping, by waiting for a set
time, or by returning immediatelymicroSec - the number of microseconds to wait if a timed wait is
specifiedcount - the number of events desired
java.io.IOException - if problems with network comunications
EtException - if arguments have bad values, the attachment's station is
GRAND_CENTRAL, or the attachment object is invalid
EtEmptyException - if the mode is asynchronous and the station's input list is empty
EtBusyException - if the mode is asynchronous and the station's input list is being used
(the mutex is locked)
EtTimeoutException - if the mode is timed wait and the time has expired
EtWakeUpException - if the attachment has been commanded to wakeup,
EventList.wakeUp(org.jlab.coda.et.AttachmentLocal), EventList.wakeUpAll()
public Event[] getEvents(Attachment att,
int mode,
int microSec,
int count)
throws java.io.IOException,
EtException,
EtEmptyException,
EtBusyException,
EtTimeoutException,
EtWakeUpException
att - attachment objectmode - if there are no events available, this parameter specifies
whether to wait for some by sleeping, by waiting for a set
time, or by returning immediatelymicroSec - the number of microseconds to wait if a timed wait is
specifiedcount - the number of events desired
java.io.IOException - if problems with network comunications
EtException - if arguments have bad values, the attachment's station is
GRAND_CENTRAL, or the attachment object is invalid
EtEmptyException - if the mode is asynchronous and the station's input list is empty
EtBusyException - if the mode is asynchronous and the station's input list is being used
(the mutex is locked)
EtTimeoutException - if the mode is timed wait and the time has expired
EtWakeUpException - if the attachment has been commanded to wakeup,
EventList.wakeUp(org.jlab.coda.et.AttachmentLocal), EventList.wakeUpAll()
public Event[] getEvents2(Attachment att,
int mode,
int microSec,
int count)
throws EtException,
EtEmptyException,
EtBusyException,
EtTimeoutException,
EtWakeUpException,
java.io.IOException
att - attachment objectmode - if there are no events available, this parameter specifies
whether to wait for some by sleeping, by waiting for a set
time, or by returning immediatelymicroSec - the number of microseconds to wait if a timed wait is
specifiedcount - the number of events desired
java.io.IOException - if problems with network comunications
EtException - if arguments have bad values, the attachment's station is
GRAND_CENTRAL, or the attachment object is invalid
EtEmptyException - if the mode is asynchronous and the station's input list is empty
EtBusyException - if the mode is asynchronous and the station's input list is being used
(the mutex is locked)
EtTimeoutException - if the mode is timed wait and the time has expired
EtWakeUpException - if the attachment has been commanded to wakeup,
EventList.wakeUp(org.jlab.coda.et.AttachmentLocal), EventList.wakeUpAll()
public void putEventsList(Attachment att,
java.util.List eventList)
throws java.io.IOException,
EtException
att - attachment objecteventList - list of event objects
java.io.IOException - if problems with network comunications
EtException - if events are not owned by this attachment or the attachment object
is invalid
public void putEvents(Attachment att,
Event[] evs)
throws java.io.IOException,
EtException
att - attachment objectevs - array of event objects
java.io.IOException - if problems with network comunications
EtException - if events are not owned by this attachment or the attachment object
is invalid
public void putEvents2(Attachment att,
Event[] evs)
throws java.io.IOException,
EtException
att - attachment objectevs - array of event objects
java.io.IOException - if problems with network comunications
EtException - if events are not owned by this attachment or the attachment object
is invalid
public void dumpEventsList(Attachment att,
java.util.List eventList)
throws java.io.IOException,
EtException
att - attachment objecteventList - list of event objects
java.io.IOException - if problems with network comunications
EtException - if events are not owned by this attachment or the attachment object
is invalid
public void dumpEvents(Attachment att,
Event[] evs)
throws java.io.IOException,
EtException
att - attachment objectevs - array of event objects
java.io.IOException - if problems with network comunications
EtException - if events are not owned by this attachment or the attachment object
is invalid
public int getNumStations()
throws java.io.IOException
java.io.IOException - if there are problems with network communication
public int getStationsMax()
throws java.io.IOException
java.io.IOException - if there are problems with network communication
public int getNumAttachments()
throws java.io.IOException
java.io.IOException - if there are problems with network communication
public int getAttachmentsMax()
throws java.io.IOException
java.io.IOException - if there are problems with network communication
public int getNumProcesses()
throws java.io.IOException
java.io.IOException - if there are problems with network communication
public int getProcessesMax()
throws java.io.IOException
java.io.IOException - if there are problems with network communication
public int getNumTemps()
throws java.io.IOException
java.io.IOException - if there are problems with network communication
public int getTempsMax()
throws java.io.IOException
java.io.IOException - if there are problems with network communication
public int getHeartbeat()
throws java.io.IOException
java.io.IOException - if there are problems with network communication
public int getPid()
throws java.io.IOException
java.io.IOException - if there are problems with network communicationpublic int getNumEvents()
public int getEventSize()
public int getLanguage()
public java.lang.String getHost()
public int getTcpPort()
public int getDebug()
public void setDebug(int val)
throws EtException
Constants.debugNone,
Constants.debugSevere, Constants.debugError,
Constants.debugWarn, or Constants.debugInfo.
val - debug level
EtException - if bad argument valuepublic SystemOpenConfig getConfig()
public AllData getData()
throws EtException,
java.io.IOException
java.io.IOException - if there are problems with network communication
EtException
public int[] getHistogram()
throws java.io.IOException,
EtException
java.io.IOException - if there are problems with network communication
EtException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||