|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JIPC session. Session can be remote and local. Remote sessions
establish conntection with the server through TCP/IP stream socket.
In this case primitives
at local computer servers as stubs and redirect requests to the server.
This mode is useful to provide sycnhronization and communication
between several Java processes at the same or different computers.
Local sessions are useful to provide synhcronization of threads within the same
process. The single local session can be shared by all threads.
Session interface provides methods for creating sycnhronization objects.
Name of the object is unique with objects of the same type
(events, semaphores,...). It is possible that, for example mutex and event
has the same name.
Method Summary | |
void |
close()
Close session. |
org.garret.jipc.JIPCBarrier |
createBarrier(java.lang.String name,
int nSessions)
Create or return existed barrier synchronization object. |
org.garret.jipc.JIPCEvent |
createEvent(java.lang.String name,
boolean signaled,
boolean manualReset)
Create or return existed event synchronization object. |
org.garret.jipc.JIPCLock |
createLock(java.lang.String name)
Create or return existed lock synchronization object. |
org.garret.jipc.JIPCMutex |
createMutex(java.lang.String name,
boolean locked)
Create or return existed mutex synchronization object. |
org.garret.jipc.JIPCQueue |
createQueue(java.lang.String name)
Create or return existed queue bject. |
org.garret.jipc.JIPCSemaphore |
createSemaphore(java.lang.String name,
int initCount)
Create or return existed semaphore synchronization object. |
org.garret.jipc.JIPCSharedMemory |
createSharedMemory(java.lang.String name,
java.io.Serializable obj)
Create or return existed shared memory object. |
boolean |
isLocal()
Checks whether it is local session |
org.garret.jipc.JIPCBarrier |
openBarrier(java.lang.String name)
Open existed barrier. |
org.garret.jipc.JIPCEvent |
openEvent(java.lang.String name)
Open existed event. |
org.garret.jipc.JIPCLock |
openLock(java.lang.String name)
Open existed lock. |
org.garret.jipc.JIPCMutex |
openMutex(java.lang.String name)
Open existed mutex. |
org.garret.jipc.JIPCQueue |
openQueue(java.lang.String name)
Open existed queue. |
org.garret.jipc.JIPCSemaphore |
openSemaphore(java.lang.String name)
Open existed semaphore. |
org.garret.jipc.JIPCSharedMemory |
openSharedMemory(java.lang.String name)
Create or return existed shared memory object. |
void |
showServerInfo(java.io.PrintStream stream)
Get information about server state. |
void |
shutdownServer()
Terminate server. |
Method Detail |
public void close() throws JIPCException, java.io.IOException
JIPCException
java.io.IOException
public org.garret.jipc.JIPCBarrier createBarrier(java.lang.String name, int nSessions) throws JIPCException, java.io.IOException
name
- unique barrier name.nSessions
- positive number of sessions to be synchronized on barrier
alreadExists
method
to check if new object is created
JIPCException
java.io.IOException
public org.garret.jipc.JIPCEvent createEvent(java.lang.String name, boolean signaled, boolean manualReset) throws JIPCException, java.io.IOException
name
- unique event name.signaled
- initial state of the event, ignored if mutex already existsmanualReset
- mode of the event, ignored if mutex already exists
alreadExists
method
to check if new object is created
JIPCException
java.io.IOException
public org.garret.jipc.JIPCLock createLock(java.lang.String name) throws JIPCException, java.io.IOException
name
- unique lock name.
alreadExists
method
to check if new object is created
JIPCException
java.io.IOException
public org.garret.jipc.JIPCMutex createMutex(java.lang.String name, boolean locked) throws JIPCException, java.io.IOException
name
- unique mutex name.locked
- initial state of the mutex, if true
then it is owned by session created this mutex, ignored if mutex already exists
alreadExists
method
to check if new object is created
JIPCException
java.io.IOException
public org.garret.jipc.JIPCQueue createQueue(java.lang.String name) throws JIPCException, java.io.IOException
name
- unique queue name.
alreadExists
method
to check if new object is created
JIPCException
java.io.IOException
public org.garret.jipc.JIPCSemaphore createSemaphore(java.lang.String name, int initCount) throws JIPCException, java.io.IOException
name
- unique semaphore name.initCount
- non-negative initial value of semaphore counter, ignored if mutex already exists
alreadExists
method
to check if new object is created
JIPCException
java.io.IOException
public org.garret.jipc.JIPCSharedMemory createSharedMemory(java.lang.String name, java.io.Serializable obj) throws JIPCException, java.io.IOException
name
- unique shared memory name.obj
- non-null initial value of shared memory object
alreadExists
method
to check if new object is created
JIPCException
java.io.IOException
public boolean isLocal()
true
is session was created by means of
org.garret.jipc.server.JIPCServer
factory, false
- if
session eas created by org.garret.jipc.client.JIPCClientFactory
.public org.garret.jipc.JIPCBarrier openBarrier(java.lang.String name) throws JIPCException, java.io.IOException
name
- barrier name
null
if barrier with such name doesn't exists
JIPCException
java.io.IOException
public org.garret.jipc.JIPCEvent openEvent(java.lang.String name) throws JIPCException, java.io.IOException
name
- event name
null
if event with such name doesn't exists
JIPCException
java.io.IOException
public org.garret.jipc.JIPCLock openLock(java.lang.String name) throws JIPCException, java.io.IOException
name
- lock name
null
if lock with such name doesn't exists
JIPCException
java.io.IOException
public org.garret.jipc.JIPCMutex openMutex(java.lang.String name) throws JIPCException, java.io.IOException
name
- mutex name
null
if mutex with such name doesn't exists
JIPCException
java.io.IOException
public org.garret.jipc.JIPCQueue openQueue(java.lang.String name) throws JIPCException, java.io.IOException
name
- queue name
null
if queue with such name doesn't exists
JIPCException
java.io.IOException
public org.garret.jipc.JIPCSemaphore openSemaphore(java.lang.String name) throws JIPCException, java.io.IOException
name
- semaphore name
null
if semaphore with such name doesn't exists
JIPCException
java.io.IOException
public org.garret.jipc.JIPCSharedMemory openSharedMemory(java.lang.String name) throws JIPCException, java.io.IOException
name
- unique shared memory name.
alreadExists
method
to check if new object is created
JIPCException
java.io.IOException
public void showServerInfo(java.io.PrintStream stream) throws JIPCException, java.io.IOException
JIPCServerMonitor
and should not be used by normal client unless it wants to monitor
server itself.
JIPCException
java.io.IOException
public void shutdownServer() throws JIPCException, java.io.IOException
JIPCServerMonitor
and should not be used by normal client unless it wants to monitor
server itself. This method do nothing for local sessions.
You should not execute any other session method after this this method.
JIPCException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |