posix
Class IPC

java.lang.Object
  extended by posix.IPC
Direct Known Subclasses:
MsgQ, SemSet, SharedMem

public abstract class IPC
extends Object

The base class of the SysV derived posix IPC methods.


Nested Class Summary
static class IPC.Perm
          Permission structure for SysV IPC resources.
 
Field Summary
static int egid
          The effective gid of the JVM when this class was initialized.
static int euid
          The effective uid of the JVM when this class was initialized.
protected  int id
           
static int IPC_ALLOC
          Mode bits for various IPC functions.
static int IPC_CI
          Mode bits for various IPC functions.
static int IPC_CREAT
          Mode bits for various IPC functions.
static int IPC_EXCL
          Mode bits for various IPC functions.
static int IPC_NOCLEAR
          Mode bits for various IPC functions.
static int IPC_NOWAIT
          Mode bits for various IPC functions.
static int IPC_PHYS
          Mode bits for various IPC functions.
static int IPC_PRIVATE
          Mode bits for various IPC functions.
protected  boolean owner
           
static int pid
          The posix process id for the process of this JVM.
 
Constructor Summary
IPC()
           
 
Method Summary
 void dispose()
           
 void finalize()
           
static int ftok(String path, int id)
          Return an IPC key from a pathname and an id.
 int getId()
           
 IPC.Perm getPerm()
           
abstract  IPC.Perm getStatus()
          Return the permissions for this IPC data structure.
static boolean isPidValid(int pid)
           
abstract  void remove()
          Remove this IPC data structure from the system.
 void setPerm(int uid, int gid, int mode)
          Set the uid, gid, mode for this IPC data structure.
abstract  void setPerm(IPC.Perm st)
          Set attributes for this IPC data structure.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected int id

owner

protected boolean owner

pid

public static final int pid
The posix process id for the process of this JVM.


euid

public static final int euid
The effective uid of the JVM when this class was initialized. It is probably not a good idea to change this in Java, so it should be current.


egid

public static final int egid
The effective gid of the JVM when this class was initialized.


IPC_PRIVATE

public static final int IPC_PRIVATE
Mode bits for various IPC functions.

See Also:
Constant Field Values

IPC_ALLOC

public static final int IPC_ALLOC
Mode bits for various IPC functions.

See Also:
Constant Field Values

IPC_CREAT

public static final int IPC_CREAT
Mode bits for various IPC functions.

See Also:
Constant Field Values

IPC_EXCL

public static final int IPC_EXCL
Mode bits for various IPC functions.

See Also:
Constant Field Values

IPC_NOWAIT

public static final int IPC_NOWAIT
Mode bits for various IPC functions.

See Also:
Constant Field Values

IPC_CI

public static final int IPC_CI
Mode bits for various IPC functions.

See Also:
Constant Field Values

IPC_NOCLEAR

public static final int IPC_NOCLEAR
Mode bits for various IPC functions.

See Also:
Constant Field Values

IPC_PHYS

public static final int IPC_PHYS
Mode bits for various IPC functions.

See Also:
Constant Field Values
Constructor Detail

IPC

public IPC()
Method Detail

isPidValid

public static boolean isPidValid(int pid)

getId

public int getId()

ftok

public static int ftok(String path,
                       int id)
Return an IPC key from a pathname and an id.


getStatus

public abstract IPC.Perm getStatus()
                            throws IPCException
Return the permissions for this IPC data structure.

Throws:
IPCException
Since:
1.2

getPerm

public IPC.Perm getPerm()
                 throws IPCException
Throws:
IPCException

setPerm

public abstract void setPerm(IPC.Perm st)
                      throws IPCException
Set attributes for this IPC data structure. In most cases, only uid, gid, mode can be changed - other fields are ignored.

Parameters:
st - a status obtained from getPerm() for this IPC and modified
Throws:
IPCException
Since:
1.2

setPerm

public void setPerm(int uid,
                    int gid,
                    int mode)
             throws IPCException
Set the uid, gid, mode for this IPC data structure. Other attributes are unchanged.

Throws:
IPCException
Since:
1.2

remove

public abstract void remove()
Remove this IPC data structure from the system.


dispose

public void dispose()

finalize

public void finalize()
Overrides:
finalize in class Object