Xindice API

org.apache.xindice.core.objects
Interface ThreadPolicy


public interface ThreadPolicy

ThreadPolicy is used by the XMLObjectManager in order to determine whether or not an XMLObject needs a new or can expose a shared instance. As a marker interface, an XMLObject implementation needn't implement ThreadPolicy if it wants to defer that control to the default behavior of the XMLObject manager.


Field Summary
static int NEW_INSTANCE
          NEW_INSTANCE marks the object as being neither sharable nor poolable.
static int POOLED_INSTANCE
          POOLED_INSTANCE marks the object as not being sharable, but capable of being reused in a pooled fashion.
static int SHARED_INSTANCE
          SHARED_INSTANCE marks the object as capable of being shared by multiple requesting threads.
 
Method Summary
 int getThreadPolicy()
          getThreadPolicy returns the Thread policy for the object instance.
 

Field Detail

SHARED_INSTANCE

public static final int SHARED_INSTANCE
SHARED_INSTANCE marks the object as capable of being shared by multiple requesting threads.

POOLED_INSTANCE

public static final int POOLED_INSTANCE
POOLED_INSTANCE marks the object as not being sharable, but capable of being reused in a pooled fashion. These objects must also implement the Poolable interface. SimpleReflectable, the base class for the generic XMLObject implementations implements Poolable for you.

NEW_INSTANCE

public static final int NEW_INSTANCE
NEW_INSTANCE marks the object as being neither sharable nor poolable. All requests for this object will generate a new instance.
Method Detail

getThreadPolicy

public int getThreadPolicy()
getThreadPolicy returns the Thread policy for the object instance.

Xindice API

Copyright (c) 1999-2001 The Apache Software Foundation