|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Manager.java Manager is the only access point that applications have to the middleware. Thus it provides a consistent API to manage the platform, send data, link information, etc. Created: Fri Jul 20 14:55:36 2001
Field Summary | |
static boolean |
CONNECTED
Signifies that we are currently connected to the network |
static boolean |
DISCONNECTED
Signifies that we are currently disconnected from the network. |
Method Summary | |
void |
addHostListener(Host host,
HostListener application)
Signifies that the given HostListener object needs
to be notified when the given Host is in reach or out of reach |
void |
addHostListener(HostListener application)
Signifies that the given HostListener object needs
to be notified when any Host becomes in reach or out of reach. |
void |
addHostListenerPrimID(java.lang.Object primID,
HostListener application)
Signifies that the given HostListener object needs
to be notified when the given Host is in reach or out of reach |
void |
addHostListenerSecID(java.lang.Object secID,
HostListener application)
Signifies that the given HostListener object needs
to be notified when the given Host is in reach or out of reach |
void |
close(org.w3c.dom.Element element,
java.lang.Integer appID)
Signifies that an element previously opened ( open() ) is no longer being accessed. |
boolean |
connect()
Connects to the network. |
void |
deleteApplication(java.lang.Integer appID)
Deletes the given application. |
void |
disconnect()
Disconnects from the network. |
void |
exit()
Quits the platform |
boolean |
export(org.w3c.dom.Element element,
java.lang.Integer appID)
Exports an element in an application tree |
boolean |
export(java.lang.String path,
java.lang.Integer appID)
Exports an Element in an application tree. |
java.util.Enumeration |
getExports()
Returns the local exports table |
java.util.Enumeration |
getHosts()
Returns a list of hosts which are currently in reach with the localhost. |
java.util.Enumeration |
getLinkedBy()
Returns the local linked by table |
java.util.Enumeration |
getLinkedFrom()
Returns the local linked from table |
java.lang.Object |
getPrimaryID()
|
ApplicationProfile |
getProfile(java.lang.Integer appID)
Returns the Application profile of the given application |
java.lang.Object |
getSecondaryID()
|
boolean |
getStatus()
Gets the status of the middleware (connected or disconnected to/from the network) |
void |
init()
Initialises the platform/middleware for the first time |
void |
link(Host host,
java.lang.Integer remoteAppID,
java.lang.String remoteElement,
java.lang.Integer localAppID,
org.w3c.dom.Element localRoot)
Issues a request to link an element from a remote host. |
org.w3c.dom.Element |
open(java.lang.String path,
java.lang.Integer appID)
Opens an Element for the application to manipulate |
void |
print(java.lang.String data)
Can be used to print debugging strings. |
void |
println(java.lang.String data)
Can be used to print debugging strings. |
void |
queue(java.lang.Object[] request)
Queue a request (protocol request) to be serviced by the middleware |
java.lang.Integer |
registerApplication(XApp app)
Registers an application with the application manager, allowing it to access the services of xmiddle |
void |
registerProtocol(java.lang.String name,
java.lang.String className)
Registers a new protocol as available to the middleware. |
void |
removeHostListener(Host host,
HostListener application)
Signifies that the given HostListener object does
not wish to be notified any more if the given host is online. |
void |
removeHostListener(HostListener application)
Signifies that the given HostListener object does
not wish to be notified of any events any more. |
void |
removeHostListenerPrimID(java.lang.Object primID,
HostListener application)
Signifies that the given HostListener object does
not wish to be notified any more if the given host is online. |
void |
removeHostListenerSecID(java.lang.Object secID,
HostListener application)
Signifies that the given HostListener object does
not wish to be notified any more if the given host is online. |
void |
resume()
Resumes after a previously executed suspend() |
void |
send(Data data)
Sends a data packet to a host. |
void |
suspend()
Suspends the platform |
void |
sync(Host host,
java.lang.Integer origAppID,
java.lang.String origPath,
java.lang.Integer localAppID,
java.lang.String localPath)
Synchronises (reconciles) our data with the given Host's. |
void |
unexport(org.w3c.dom.Element element,
java.lang.Integer appID)
Stops exporting the given element |
void |
unexport(java.lang.String path,
java.lang.Integer appID)
Stops exporting the given element |
void |
unlink(org.w3c.dom.Element element,
java.lang.Integer appID)
Stops linking at the given element |
Field Detail |
public static final boolean CONNECTED
public static final boolean DISCONNECTED
Method Detail |
public void init()
public void suspend()
public void resume()
suspend()
public void exit()
public void print(java.lang.String data)
data
- The String
to printpublic void println(java.lang.String data)
String
with a newline character
data
- The String
to printpublic org.w3c.dom.Element open(java.lang.String path, java.lang.Integer appID)
path
- an xpath expression describing the element to open.appID
- The application ID to which the element belongs.
NULL
if the element does
not exists, the xpath expression was invalid or access was
denied.public void close(org.w3c.dom.Element element, java.lang.Integer appID)
open()
) is no longer being accessed.
element
- the Element
not being accessedappID
- The application ID to which this element belongs.public java.util.Enumeration getHosts()
Enumeration
valuepublic boolean connect()
true
is it succeeds, false
otherwise.public void disconnect()
public boolean getStatus()
CONNECTED
or DISCONNECTED
public boolean export(java.lang.String path, java.lang.Integer appID)
path
- The element encoded as an xpath expression.appID
- The application ID on the tree of which the
element resides
public boolean export(org.w3c.dom.Element element, java.lang.Integer appID)
element
- The elementappID
- The application ID on the tree of which the
element resides
public void unexport(java.lang.String path, java.lang.Integer appID)
path
- The element, encoded as an xpath expression.appID
- The application ID identifying the application on
the tree of which the element resides.public void unexport(org.w3c.dom.Element element, java.lang.Integer appID)
element
- The elementappID
- The application ID identifying the application on
the tree of which the element resides.public void send(Data data)
data
- The packet (the Data
structure also
contains the target host)public void queue(java.lang.Object[] request)
request
- the request, as an Object[]
valuepublic void link(Host host, java.lang.Integer remoteAppID, java.lang.String remoteElement, java.lang.Integer localAppID, org.w3c.dom.Element localRoot)
host
- The host which exports the elementremoteAppID
- The remote application which exports the
element.remoteElement
- The element, encoded as an xpath
expression being exported.localAppID
- the ID of the application which requests the
linking and on which localRoot
resideslocalRoot
- The local Element under which the remote
element will be linked if the operation succeedspublic void sync(Host host, java.lang.Integer origAppID, java.lang.String origPath, java.lang.Integer localAppID, java.lang.String localPath)
host
- The host on which the element resides.localAppID
- The application ID on the localhost.localPath
- The path name on the localhost.public void unlink(org.w3c.dom.Element element, java.lang.Integer appID)
appID
- the ID of the application to which
element belongs.
public java.util.Enumeration getExports()
Enumeration
of the local exports
table. The actual objects contained in the Enumeration are left
to the implementorpublic java.util.Enumeration getLinkedBy()
Enumeration
of the local linked by
table. The actual objects contained in the Enumeration are left
to the implementorpublic java.util.Enumeration getLinkedFrom()
Enumeration
of the local linked from
table. The actual objects contained in the Enumeration are left
to the implementorpublic void registerProtocol(java.lang.String name, java.lang.String className)
name
- The name of the protocol which must be unique.className
- The absolute classname of the protocol, which
can be used by the ProtocolChooser
to load the
protocol. Protocols are expected to extend
edu.UCL.xmiddle.lib.protocols.Protocol
public java.lang.Integer registerApplication(XApp app)
app
- The application to register
public ApplicationProfile getProfile(java.lang.Integer appID)
appID
- The ID of the application of which the profile is
desired
public void deleteApplication(java.lang.Integer appID)
appID
- the ID of the application we wish to deletepublic void addHostListener(HostListener application)
HostListener
object needs
to be notified when any Host becomes in reach or out of reach.
application
- The object to be notified.public void addHostListener(Host host, HostListener application)
HostListener
object needs
to be notified when the given Host is in reach or out of reach
host
- The hostapplication
- The object to be notifiedpublic void addHostListenerSecID(java.lang.Object secID, HostListener application)
HostListener
object needs
to be notified when the given Host is in reach or out of reach
secID
- The host, identified (NOT uniquely) by its
secondary ID.application
- The object to be notifiedpublic void addHostListenerPrimID(java.lang.Object primID, HostListener application)
HostListener
object needs
to be notified when the given Host is in reach or out of reach
primID
- The host, identified by its primary IDapplication
- The object to be notifiedpublic void removeHostListener(HostListener application)
HostListener
object does
not wish to be notified of any events any more.
application
- The object not to be notified any more.public void removeHostListener(Host host, HostListener application)
HostListener
object does
not wish to be notified any more if the given host is online.
host
- The hostapplication
- The object not to be notified any morepublic void removeHostListenerSecID(java.lang.Object secID, HostListener application)
HostListener
object does
not wish to be notified any more if the given host is online.
secID
- The host, identified (NOT uniquely) by its
secondary IDapplication
- The object not to be notified any morepublic void removeHostListenerPrimID(java.lang.Object primID, HostListener application)
HostListener
object does
not wish to be notified any more if the given host is online.
primID
- The host, identified by its primaryIDapplication
- The object not to be notified any morepublic java.lang.Object getPrimaryID()
public java.lang.Object getSecondaryID()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |