|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jlab.coda.et.SystemCreate
This class creates an ET system.
| Field Summary | |
(package private) java.util.HashMap |
attachments
Table of all ET system attachments. |
(package private) SystemConfig |
config
A copy of the ET system configuration. |
(package private) int |
dataLength
Length of valid data in array storing system information. |
(package private) java.util.HashMap |
events
Table of all ET system events. |
(package private) byte[] |
infoArray
Array for storing system information for distribution. |
(package private) boolean |
killAllThreads
Flag for killing all threads started by ET system. |
(package private) java.lang.String |
name
The name of the ET system file name. |
(package private) java.net.InetAddress[] |
netAddresses
All local IP addresses |
(package private) int |
stationCount
The total number of idle and active stations. |
(package private) byte[] |
stationLock
Mutex for station stuff. |
(package private) java.util.LinkedList |
stations
A list of stations defining the flow of events. |
(package private) byte[] |
systemLock
Mutex for system stuff. |
| Constructor Summary | |
SystemCreate(java.lang.String _name)
Creates a new ET system using default parameters and starts it running. |
|
SystemCreate(java.lang.String _name,
SystemConfig _config)
Creates a new ET system with specified parameters and starts it running. |
|
| Method Summary | |
(package private) AttachmentLocal |
attach(int statId)
Create an attachment to a station. |
StationLocal |
createStation(StationConfig stationConfig,
java.lang.String name)
Creates a new station placed at the end of the linked list of stations. |
(package private) StationLocal |
createStation(StationConfig stationConfig,
java.lang.String name,
int position,
int parallelPosition)
Creates a new station at a specified position in the linked list of stations. |
(package private) void |
detach(AttachmentLocal att)
Remove an attachment from a station. |
(package private) void |
dumpEvents(AttachmentLocal att,
Event[] eventArray)
Dispose of unwanted events in an ET system. |
(package private) int |
gatherSystemData()
Gather all ET system data for sending over the network and put it into a single byte array. |
SystemConfig |
getConfig()
Gets the ET system configuration. |
(package private) Event[] |
getEvents(AttachmentLocal att,
int mode,
int microSec,
int count)
Get events from an ET system. |
java.lang.String |
getName()
Gets the ET system file name. |
(package private) int |
getStationParallelPosition(int statId)
Gets the position of a parallel station in its linked list of parallel stations. |
(package private) int |
getStationPosition(int statId)
Gets the position of a station in the main linked list of stations. |
(package private) Event[] |
newEvents(AttachmentLocal att,
int mode,
int microSec,
int count,
int size)
Get new or unused events from an ET system. |
(package private) void |
putEvents(AttachmentLocal att,
Event[] eventArray)
Put events into an ET system. |
(package private) void |
removeStation(int statId)
Removes an existing station. |
boolean |
running()
Tells if the ET system is running or not. |
(package private) void |
setStationPosition(int statId,
int position,
int parallelPosition)
Changes the position of a station in the linked lists of stations. |
void |
shutdown()
Stops the ET system if it is running. |
void |
startUp()
Starts the ET system running. |
(package private) boolean |
stationAttached(int statId,
int attId)
Tells if an attachment is attached to a station. |
(package private) boolean |
stationExists(StationLocal station)
Tells if a station exists. |
(package private) boolean |
stationExists(java.lang.String name)
Tells if a station exists. |
(package private) StationLocal |
stationIdToObject(int statId)
Given a station id number, this method gets the corresponding StationLocal object. |
(package private) StationLocal |
stationNameToObject(java.lang.String name)
Gets a station's object representation. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
SystemConfig config
java.lang.String name
java.util.LinkedList stations
int stationCount
java.util.HashMap attachments
java.util.HashMap events
java.net.InetAddress[] netAddresses
byte[] systemLock
byte[] stationLock
volatile boolean killAllThreads
int dataLength
byte[] infoArray
| Constructor Detail |
public SystemCreate(java.lang.String _name)
throws EtException
Constants.defaultNumEvents,
event size = Constants.defaultEventSize,
max number of stations = Constants.defaultStationsMax,
max number of attachments = Constants.defaultAttsMax,
debug level = Constants.debugError,
udp port = Constants.broadcastPort,
server (tcp) port = Constants.serverPort, and
multicasting port = Constants.multicastPort
_name - file name
EtException - if the file already exists or cannot be created
public SystemCreate(java.lang.String _name,
SystemConfig _config)
throws EtException
_name - file name_config - ET system configuration
EtException - if the file already exists or cannot be created| Method Detail |
public java.lang.String getName()
public SystemConfig getConfig()
public boolean running()
true if the system is running and false
if it is notpublic void startUp()
public void shutdown()
public StationLocal createStation(StationConfig stationConfig,
java.lang.String name)
throws EtException,
EtExistsException,
EtTooManyException
stationConfig - station configurationname - station name
EtException - if the select method's class cannot be loaded
EtExistsException - if the station already exists but with a different configuration
EtTooManyException - if the maximum number of stations has been created already
StationLocal createStation(StationConfig stationConfig,
java.lang.String name,
int position,
int parallelPosition)
throws EtException,
EtExistsException,
EtTooManyException
stationConfig - station configurationname - station nameposition - position in the linked list to put the station.
EtException - if the select method's class cannot be loaded
EtExistsException - if the station already exists but with a different configuration
EtTooManyException - if the maximum number of stations has been created already
void removeStation(int statId)
throws EtException
statId - station id
EtException - if attachments to the station still exist or the station does not exist
void setStationPosition(int statId,
int position,
int parallelPosition)
throws EtException
statId - station idposition - position in the main linked list of stations (starting at 0)parallelPosition - position of a parallel station in a group of
parallel stations (starting at 0)
EtException - if the station does not exist, or
if 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.
int getStationPosition(int statId)
throws EtException
statId - station id
EtException - if the station does not exist
int getStationParallelPosition(int statId)
throws EtException
statId - station id
EtException - if the station does not exist
boolean stationAttached(int statId,
int attId)
throws EtException
statId - station idattId - attachment id
true if an attachment is attached to a station
and false otherwise
EtException - if the station does not existboolean stationExists(StationLocal station)
station - station object
true if a station exists and
false otherwiseboolean stationExists(java.lang.String name)
name - station name
true if a station exists and
false otherwise
StationLocal stationNameToObject(java.lang.String name)
throws EtException
name - station name
EtException - if the station does not exist
StationLocal stationIdToObject(int statId)
throws EtException
EtException - if the station does not exist
AttachmentLocal attach(int statId)
throws EtException,
EtTooManyException
statId - station id
EtException - if the station does not exist
EtTooManyException - if station does not exist, or
if no more attachments are allowed to the station, or
if no more attachments are allowed to ET systemvoid detach(AttachmentLocal att)
att - attachment object
Event[] newEvents(AttachmentLocal att,
int mode,
int microSec,
int count,
int size)
throws 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 immediately (asynchronous)microSec - the number of microseconds to wait if a timed wait is
specifiedcount - the number of events desiredsize - the size of events in bytes
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()
Event[] getEvents(AttachmentLocal att,
int mode,
int microSec,
int count)
throws 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 immediately (asynchronous)microSec - the number of microseconds to wait if a timed wait is
specifiedcount - the number of events desired
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()
void putEvents(AttachmentLocal att,
Event[] eventArray)
att - attachment objecteventArray - array of event objects
void dumpEvents(AttachmentLocal att,
Event[] eventArray)
att - attachment objecteventArray - array of event objectsint gatherSystemData()
Constants.ok if everything is fine and
Constants.error otherwise
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||