BEA Systems, Inc.

WebLogic Server 5.1.0 API Reference

weblogic.common
Interface T3ResourceDef


public interface T3ResourceDef

A T3ResourceDef defines scarce resource allocation within the WebLogic Server.

Author:
Copyright (c) 1996-1998 WebLogic, Inc. All Rights Reserved., Copyright (c) 1998-1999 BEA Systems, Inc. All Rights Reserved.
Copyright © 2000 BEA Systems, Inc. All Rights Reserved.
See Also:
T3ResourceFactory

Field Summary
static int CAPACITY
          Maximum number of resources that can be reserved.
static int CAPACITYINCREMENT
          Number by which the size of resource allocation is incremented.
static int CREATED
          Total number of resources recycled during this session.
static int CURRENTINUSE
          Total number of resources currently in use.
static int ENABLED
          Is this pool enabled for use?
static int INITIALCAPACITY
          Initial number of resources that should be reserved.
static int LASTUSAGE
          The last snapshot taken of resources in-use.
static int POOLUSEHIST
          The last snapshot taken of resources in-use, as needed by the console for strip chart construction.
static int RECYCLED
          Total number of resources recycled during this session.
static int RELEASED
          Total number of resources released during this session.
static int REQUESTED
          Total number of resources requested during this session.
static int RUNNINGAVERAGE
          Running average of resources in-use.
static int SIZE
          Number of resources currently reserved.
 
Method Summary
 int getInfo(int infoItem)
          Gets information about the resource allocator.
 void refreshResources()
          Refreshes all the resources presently allocated.
 void release(java.lang.Object o)
          Releases a reserved resource.
 java.lang.Object reserve(java.security.Principal user)
          Reserves a resource with permission check on behalf of the specified user.
 java.lang.Object reserveNoWait(java.security.Principal user)
          Reserves a resource with permission check on behalf of the specified user.
 java.lang.Object reserveWaitSecs(java.security.Principal user, int waitSecs)
          Reserves a resource with permission check on behalf of the specified user.
 void setResourceFactory(T3ResourceFactory rf)
          Sets the factory to be used for obtaining new resources.
 

Field Detail

SIZE

public static final int SIZE
Number of resources currently reserved.

INITIALCAPACITY

public static final int INITIALCAPACITY
Initial number of resources that should be reserved.

CAPACITY

public static final int CAPACITY
Maximum number of resources that can be reserved.

CAPACITYINCREMENT

public static final int CAPACITYINCREMENT
Number by which the size of resource allocation is incremented.

REQUESTED

public static final int REQUESTED
Total number of resources requested during this session.

RELEASED

public static final int RELEASED
Total number of resources released during this session.

CURRENTINUSE

public static final int CURRENTINUSE
Total number of resources currently in use.

CREATED

public static final int CREATED
Total number of resources recycled during this session.

RECYCLED

public static final int RECYCLED
Total number of resources recycled during this session.

RUNNINGAVERAGE

public static final int RUNNINGAVERAGE
Running average of resources in-use.

LASTUSAGE

public static final int LASTUSAGE
The last snapshot taken of resources in-use.

POOLUSEHIST

public static final int POOLUSEHIST
The last snapshot taken of resources in-use, as needed by the console for strip chart construction.

ENABLED

public static final int ENABLED
Is this pool enabled for use?
Method Detail

reserve

public java.lang.Object reserve(java.security.Principal user)
                         throws ResourceException
Reserves a resource with permission check on behalf of the specified user. If no resource is immediately available, hangs until one is available.

Parameters:
user - Principal object
Throws:
ResourceException - if there is no resource immediately available

reserveNoWait

public java.lang.Object reserveNoWait(java.security.Principal user)
                               throws ResourceException
Reserves a resource with permission check on behalf of the specified user. If no resource is available immediately throws a Resource Exception.

Parameters:
user - Principal object
Throws:
ResourceException - if there is no resource available

reserveWaitSecs

public java.lang.Object reserveWaitSecs(java.security.Principal user,
                                        int waitSecs)
                                 throws ResourceException
Reserves a resource with permission check on behalf of the specified user. If no resource is available within waitSecs seconds throws a Resource Exception.

Parameters:
user - Principal object
waitSecs - Seconds to wait for resource
Throws:
ResourceException - if there is no resource available within waitSecs seconds

release

public void release(java.lang.Object o)
Releases a reserved resource.

Parameters:
o - Object that was previously reserved

setResourceFactory

public void setResourceFactory(T3ResourceFactory rf)
                        throws ResourceException
Sets the factory to be used for obtaining new resources. When the resource allocator needs a new object, it invokes T3ResourceFactory.createResource().

Parameters:
rf - Resource factory that allocates objects
Throws:
ResourceException - if there is no resource available

getInfo

public int getInfo(int infoItem)
Gets information about the resource allocator.

Parameters:
infoItem - One of the final static ints in this class
Returns:
Value for the info item

refreshResources

public void refreshResources()
                      throws ResourceException
Refreshes all the resources presently allocated.

Throws:
ResourceException - if there is an error

Documentation is available at
http://www.weblogic.com/docs51