com.rhi.architecture.resource
Class ResourceContext

java.lang.Object
  extended bycom.rhi.architecture.resource.ResourceContext

public class ResourceContext
extends java.lang.Object

The ResourceContext class is a pseudo InitialContext. It is responsible for servicing lookups from the application classes to a set of the ResourceFactories. It creates & initializes the Factories during application startup, and call the Factory cleanup methods during application shutdown.

Since:
1.0
Author:
Pete McKinstry

Constructor Summary
ResourceContext()
          Default Constructor
 
Method Summary
 void cleanup()
          Perform whatever cleanup is required of the underlying object..
 void init(java.util.Properties p)
          Load the configured ResourceFactories.
 java.lang.Object lookup(java.lang.Object name)
          Lookup a resource by name.
 void register(java.lang.Object name, Resource resource)
          Manually register a resource w/ the ResourceContext object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceContext

public ResourceContext()
Default Constructor

Since:
1.0
Method Detail

init

public void init(java.util.Properties p)
          throws InitializationException
Load the configured ResourceFactories.

Parameters:
p -
Throws:
InitializationException
Since:
1.0

register

public void register(java.lang.Object name,
                     Resource resource)
Manually register a resource w/ the ResourceContext object.

Parameters:
name - name by which this resource will be known. Similar to the JNDI name for an object in J2EE land.
resource - Resource to be managed by the Context object.
Since:
1.0

lookup

public java.lang.Object lookup(java.lang.Object name)
Lookup a resource by name. If found, return to caller. Else return null.

Parameters:
name -
Returns:
Object
Since:
1.0

cleanup

public void cleanup()
Perform whatever cleanup is required of the underlying object..

Since:
1.1


Copyright © 2002-2004 Robert Half International. All Rights Reserved.