|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectibis.ipl.Ibis
This class defines the Ibis API, which can be implemented by an Ibis
implementation. Every JVM may run multiple Ibis implementations.
The user can request a list of available implementations, query their
properties, and then load the desired Ibis implementation at runtime.
An Ibis implementation offers certain PortType properties.
On startup, Ibis tries to load properties files in the following order:
- ibis.property.file;
- a file named "properties" in the classpath.
- current_dir/ibis_properties;
- home_dir/ibis_properties.
Constructor Summary | |
Ibis()
|
Method Summary | |
static Ibis |
createIbis(StaticProperties reqprop,
ResizeHandler r)
Creates a new Ibis instance, based on the required properties, or on the system property "ibis.name", or on the staticproperty "name". |
static Ibis |
createIbis(java.lang.String name,
java.lang.String implName,
ResizeHandler resizeHandler)
Deprecated. The prefered method for creating Ibis instances is createIbis(ibis.ipl.StaticProperties, ibis.ipl.ResizeHandler) . |
PortType |
createPortType(java.lang.String nm,
StaticProperties p)
Creates a PortType . |
abstract void |
died(IbisIdentifier[] corpses)
Notifies this Ibis instance that another Ibis instance has died. |
abstract void |
disableResizeUpcalls()
Disables reception of ResizeHandler upcalls. |
abstract void |
enableResizeUpcalls()
Allows reception of ResizeHandler
upcalls. |
abstract void |
end()
Returns all Ibis recources to the system. |
abstract PortType |
getPortType(java.lang.String nm)
Returns the PortType corresponding to
the given name. |
java.lang.String |
getVersion()
Returns the current Ibis version. |
abstract IbisIdentifier |
identifier()
Returns an Ibis identifier for this Ibis instance. |
java.lang.String |
implementationName()
Returns the implementation name of this Ibis instance. |
abstract void |
joined(IbisIdentifier joinIdent)
Notifies this Ibis instance that another Ibis instance has joined the run. |
abstract void |
left(IbisIdentifier leaveIdent)
Notifies this Ibis instance that another Ibis instance has left the run. |
static java.lang.String[] |
list()
Returns a list of available Ibis implementation names for this system. |
static Ibis[] |
loadedIbises()
Returns a list of all Ibis implementations that are currently loaded. |
static void |
loadLibrary(java.lang.String name)
Loads a native library with ibis. |
java.lang.String |
name()
Deprecated. If you need the name of an Ibis instance, you can use IbisIdentifier.toString() . |
abstract void |
poll()
Polls the network for new messages. |
StaticProperties |
properties()
Returns the properties of this Ibis implementation. |
abstract Registry |
registry()
Returns the Ibis Registry. |
static StaticProperties |
staticProperties(java.lang.String implName)
Returns the static properties for a certain implementation. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Ibis()
Method Detail |
public static void loadLibrary(java.lang.String name) throws java.lang.SecurityException, java.lang.UnsatisfiedLinkError
name
- the name of the library to be loaded.
java.lang.SecurityException
- may be thrown by loadLibrary.
java.lang.UnsatisfiedLinkError
- may be thrown by loadLibrary.public static Ibis createIbis(java.lang.String name, java.lang.String implName, ResizeHandler resizeHandler) throws IbisException, ConnectionRefusedException
createIbis(ibis.ipl.StaticProperties, ibis.ipl.ResizeHandler)
.
name
- a unique name, identifying this Ibis instance.implName
- the name of the implementation.resizeHandler
- will be invoked when Ibises join and leave, and
may be null to indicate that resize notifications are not wanted.
IbisException
- two Ibis instances with the same
implName are created, or any IbisException the implementation
throws at its initialization
java.lang.IllegalArgumentException
- name or implName are null, or
do not correspond to an existing Ibis implementation
ConnectionRefusedException
- is thrown when the name turns
out to be not unique.public static Ibis[] loadedIbises()
public static Ibis createIbis(StaticProperties reqprop, ResizeHandler r) throws IbisException
reqprop
- static properties required by the application,
or null
.r
- a ResizeHandler
instance
if upcalls for joining or leaving ibis instances are required,
or null
.
NoMatchingIbisException
- is thrown when no Ibis was
found that matches the properties required.
IbisException
public static java.lang.String[] list()
public static StaticProperties staticProperties(java.lang.String implName)
implName
- implementation name of an Ibis for which
properties are requested.
null
if not present.public abstract void enableResizeUpcalls()
ResizeHandler
upcalls.
If a ResizeHandler
is installed,
this call blocks until its
joined()
upcall for this Ibis is invoked.
public abstract void disableResizeUpcalls()
ResizeHandler
upcalls.
public abstract void end() throws java.io.IOException
java.io.IOException
public PortType createPortType(java.lang.String nm, StaticProperties p) throws java.io.IOException, IbisException
PortType
.
A name is given to the PortType
(e.g. "satin porttype"
or "RMI porttype"), and Port properties are specified (for example
ports are "totally-ordered" and "reliable" and support "NWS").
If no static properties are given, the properties that were
requested from the Ibis implementation are used, possibly combined
with properties specified by the user (using the
-Dibis.<category>="..." mechanism).
If static properties are given,
the default properties described above are used for categories
not specifiedby the given properties.
The name and properties together define the
PortType
.
If two Ibis instances want to communicate, they must both
create a PortType
with the same name and properties.
If multiple implementations try to create a PortType
with the same name but different properties, an IbisException will
be thrown.
A PortType
can be used to create
ReceivePorts
and
SendPorts
.
Only ReceivePort
s and SendPort
s of
the same PortType
can communicate.
Any number of ReceivePort
s and SendPort
s
can be created on a JVM (even of the same PortType
).
nm
- name of the porttype.p
- properties of the porttype.
IbisException
- is thrown when Ibis configuration,
name or p are misconfigured
java.io.IOException
- may be thrown for instance when communication
with a nameserver fails.public abstract PortType getPortType(java.lang.String nm)
PortType
corresponding to
the given name.
nm
- the name of the requested port type.
null
if the given name is not the name of a valid port type.public abstract Registry registry()
public StaticProperties properties()
public abstract void poll() throws java.io.IOException
java.io.IOException
- is thrown when a communication error occurs.public java.lang.String name()
IbisIdentifier.toString()
.
public java.lang.String implementationName()
public abstract IbisIdentifier identifier()
public java.lang.String getVersion()
public abstract void joined(IbisIdentifier joinIdent)
joinIdent
- the Ibis identifier of the Ibis instance joining the run.public abstract void left(IbisIdentifier leaveIdent)
leaveIdent
- the Ibis identifier of the Ibis instance leaving the run.public abstract void died(IbisIdentifier[] corpses)
corpses
- the Ibis identifiers of the Ibis instances that died.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |