PageBoxLib
Class PageBoxAPI

java.lang.Object
  extended byPageBoxLib.PageBoxAPI

public class PageBoxAPI
extends java.lang.Object

Class of the PageBox API.

Changes:

alexis.grandemange@pagebox.net

Copyright (c) 2002-2004 Alexis Grandemange

This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public License
 as published by the Free Software Foundation; version 2.1 of the
 License.
 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 GNU Lesser General Public License for more details.
 A copy of the GNU Lesser General Public License lesser.txt should be
 included in the distribution.

Version:
0, 0, 13
Author:
Alexis Grandemange

Field Summary
(package private)  APIImpl impl
          Handle on a APIImpl instance
(package private)  java.lang.SecurityManager sm
          Handle to the Security Manager.
 
Constructor Summary
PageBoxAPI(java.lang.String archDir)
          Constructor.
 
Method Summary
 void ActiveNamingLogoff()
          Active Naming method.
 void ActiveNamingLogon()
          Active Naming method.
 void addEntry(java.lang.String name, java.io.Serializable must, ActiveComparable niceif, java.lang.String url)
          Active Naming method.
 void clearEntries()
          Active Naming method.
 java.lang.String getCandidate(java.lang.String name, java.io.Serializable must, ActiveComparable niceif)
          Active Naming method.
 java.lang.String[] getClones()
          Retrieves the path of this archive clones.
 java.sql.Connection getConnection()
          Gets a connection from the connection pool.
 java.lang.String getControllingPageBoxURL()
          Get the URL of the DeployIF Web service of the controlling PageBox.
 java.lang.String[] getEntries()
          Active Naming method.
 ExtensionIF getExtension(java.lang.String name, java.lang.String parmClass, java.lang.Object parm)
          Get an extension provided by the PageBox.
 LogIF getLog()
          Returns a Logging object.
 ResourceInfo getResource(java.lang.String name)
          Get information about a Application server resource.
 ResourceUsage getResourceUsage()
          Returns resource (CPU, memory) on this PageBox instance.
 boolean registerCallback(TokenCallbackIF tci)
          Register a PageBoxAPI callback.
 void relConnections()
          Releases JDBC connections.
static void relConnections(java.lang.String archDir)
          Releases JDBC connections.
 void removeEntry(java.lang.String name)
          Active Naming method.
 boolean unregisterCallback()
          Unregister a PageBoxAPI callback.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

impl

APIImpl impl
Handle on a APIImpl instance


sm

java.lang.SecurityManager sm
Handle to the Security Manager. Tested for null.

Constructor Detail

PageBoxAPI

public PageBoxAPI(java.lang.String archDir)
           throws java.security.PrivilegedActionException
Constructor. Gets a handle on a APIImpl instance.

Parameters:
archDir - directory where the archive is defined
Method Detail

relConnections

public static void relConnections(java.lang.String archDir)
Releases JDBC connections.

Parameters:
archDir - directory where the archive is defined

relConnections

public void relConnections()
Releases JDBC connections.


getLog

public LogIF getLog()
Returns a Logging object.

Returns:
interface to log or null

getConnection

public java.sql.Connection getConnection()
Gets a connection from the connection pool.

Returns:
PoolEntry JDBC connection wrapper or null

getResource

public ResourceInfo getResource(java.lang.String name)
Get information about a Application server resource.

Returns:
ResourceInfo object (JNDI name, type and auth)

getExtension

public ExtensionIF getExtension(java.lang.String name,
                                java.lang.String parmClass,
                                java.lang.Object parm)
Get an extension provided by the PageBox.

Parameters:
name - extension name
parmClass - class of the parm
parm - extension constructor parameter
Returns:
extension instance implementing the ExtensionIF interface

getClones

public java.lang.String[] getClones()
Retrieves the path of this archive clones.

Returns:
array of archive URLs or null

registerCallback

public boolean registerCallback(TokenCallbackIF tci)
Register a PageBoxAPI callback.

Returns:
true in case of success

unregisterCallback

public boolean unregisterCallback()
Unregister a PageBoxAPI callback.

Returns:
true in case of success

getControllingPageBoxURL

public java.lang.String getControllingPageBoxURL()
Get the URL of the DeployIF Web service of the controlling PageBox.

Returns:
URL of the DeployIF Web service of the controlling PageBox

ActiveNamingLogon

public void ActiveNamingLogon()
Active Naming method. Client method. Register to the ring to get ActiveNaming data.


ActiveNamingLogoff

public void ActiveNamingLogoff()
Active Naming method. Client method. Unregister to the ring to stop getting ActiveNaming data.


getEntries

public java.lang.String[] getEntries()
Active Naming method. Client method. List entry points.

Returns:
array of entry logical names

getCandidate

public java.lang.String getCandidate(java.lang.String name,
                                     java.io.Serializable must,
                                     ActiveComparable niceif)
Active Naming method. Client method. Returns a candidate.

Parameters:
name - entry name
must - imperative criteria
niceif - optional criteria
Returns:
URL of the Web service or page

addEntry

public void addEntry(java.lang.String name,
                     java.io.Serializable must,
                     ActiveComparable niceif,
                     java.lang.String url)
Active Naming method. Server method. Adds or replace an entry.

Parameters:
name - entry name
must - imperative criteria
niceif - optional criteria
url - entry url

removeEntry

public void removeEntry(java.lang.String name)
Active Naming method. Server method. Removes an entry.

Parameters:
name - entry name

clearEntries

public void clearEntries()
Active Naming method. Server method. Removes all the archive entries.


getResourceUsage

public ResourceUsage getResourceUsage()
Returns resource (CPU, memory) on this PageBox instance.

Returns:
ResourceUsage object