Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.database
Class DbInterceptorManager

java.lang.Object
  extended by com.jivesoftware.forum.database.DbInterceptorManager
All Implemented Interfaces:
JiveManager, InterceptorManager

public class DbInterceptorManager
extends java.lang.Object
implements InterceptorManager, JiveManager

Implementation of the InterceptorManager interface.


Field Summary
static java.lang.String[] ENT_DEFAULT_INTERCEPTOR_CLASSES
          The list of the class names of the interceptors that are available for installation by default.
static java.lang.String[] PRO_DEFAULT_INTERCEPTOR_CLASSES
           
 
Constructor Summary
DbInterceptorManager(int objectType, long objectID)
          Creates a new interceptor manager.
 
Method Summary
 void addInterceptor(int index, MessageInterceptor interceptor)
          Inserts a new interceptor at specified index in the list of currently configured interceptors.
 void addInterceptorClass(java.lang.String className)
          Installs a new class into the list of available interceptors for the system.
 void destroy()
          Notifies the manager to release any resources that may be holding on too.
 MessageInterceptor[] getAvailableInterceptors()
          Returns an array of MessageInterceptor objects that are all of the currently available incerceptors in the system.
 MessageInterceptor getInterceptor(int index)
          Return the interceptor at the specified index in the list of currently configured interceptors.
 int getInterceptorCount()
          Returns the count of currently active interceptors.
 void initialize()
          Initialize the manager.
 void invokeInterceptors(ForumMessage message, int type)
          Invokes all currently-installed interceptors on the specified message.
 void removeInterceptor(int index)
          Removes the specified interceptor from the list of interceptors.
 void saveInterceptors()
          Saves all interceptors to the persistent store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENT_DEFAULT_INTERCEPTOR_CLASSES

public static final java.lang.String[] ENT_DEFAULT_INTERCEPTOR_CLASSES
The list of the class names of the interceptors that are available for installation by default. These values are automatically added into the jive_interceptors.xml file when it is first created. Further classes can be defined by editing the jiveInterceptors.interceptorClasses property.


PRO_DEFAULT_INTERCEPTOR_CLASSES

public static final java.lang.String[] PRO_DEFAULT_INTERCEPTOR_CLASSES
Constructor Detail

DbInterceptorManager

public DbInterceptorManager(int objectType,
                            long objectID)
Creates a new interceptor manager.

Parameters:
objectType - the type of the object to manage interceptors on.
objectID - the objectID to manage interceptors on.
Method Detail

initialize

public void initialize()
Description copied from interface: JiveManager
Initialize the manager. It is within this method that it is ok to create, access and/or otherwise use external classes (including caches). Until this method is called implementation should not access any external classes that could possibly either access one of the main Factory classes or any caches since doing so can cause deadlocks and possible clustering issues during startup.

This method is used internally by Jive during application startup and should not be called during normal usage of the class.

Specified by:
initialize in interface JiveManager

destroy

public void destroy()
Description copied from interface: JiveManager
Notifies the manager to release any resources that may be holding on too. This could also be used to clear out the managers caches, etc.

This method is used internally by Jive during application startup and should not be called during normal usage of the class.

Specified by:
destroy in interface JiveManager

getInterceptor

public MessageInterceptor getInterceptor(int index)
Description copied from interface: InterceptorManager
Return the interceptor at the specified index in the list of currently configured interceptors.

Specified by:
getInterceptor in interface InterceptorManager
Parameters:
index - the index in the list of interceptors.
Returns:
the interceptor at the specified index.

getInterceptorCount

public int getInterceptorCount()
Description copied from interface: InterceptorManager
Returns the count of currently active interceptors.

Specified by:
getInterceptorCount in interface InterceptorManager
Returns:
a count of the currently active interceptors.

addInterceptor

public void addInterceptor(int index,
                           MessageInterceptor interceptor)
Description copied from interface: InterceptorManager
Inserts a new interceptor at specified index in the list of currently configured interceptors.

Specified by:
addInterceptor in interface InterceptorManager
Parameters:
index - the index in the list to insert the new interceptor at.
interceptor - the interceptor to add.

removeInterceptor

public void removeInterceptor(int index)
Description copied from interface: InterceptorManager
Removes the specified interceptor from the list of interceptors.

Specified by:
removeInterceptor in interface InterceptorManager
Parameters:
index - the index of the interceptor to remove.

saveInterceptors

public void saveInterceptors()
Description copied from interface: InterceptorManager
Saves all interceptors to the persistent store. This method should be called after setting any properties on individual interceptors that are being managed by this interceptor manager.

Specified by:
saveInterceptors in interface InterceptorManager

getAvailableInterceptors

public MessageInterceptor[] getAvailableInterceptors()
Description copied from interface: InterceptorManager
Returns an array of MessageInterceptor objects that are all of the currently available incerceptors in the system.

Specified by:
getAvailableInterceptors in interface InterceptorManager
Returns:
an array of all available interceptors in the current context.

addInterceptorClass

public void addInterceptorClass(java.lang.String className)
                         throws java.lang.ClassNotFoundException,
                                java.lang.IllegalArgumentException
Description copied from interface: InterceptorManager
Installs a new class into the list of available interceptors for the system. Exceptions are thrown if you're not an administrator, the class can't be loaded from the classpath, or the class isn't an instance of MessageInterceptor.

Specified by:
addInterceptorClass in interface InterceptorManager
Parameters:
className - the fully qualified name of the class to add to the list of available filters in the system.
Throws:
java.lang.ClassNotFoundException - if the class could not be loaded.
java.lang.IllegalArgumentException - if the class is not a filter or could not be instantiated.

invokeInterceptors

public void invokeInterceptors(ForumMessage message,
                               int type)
                        throws MessageRejectedException
Invokes all currently-installed interceptors on the specified message. Only interceptors of the specified type are invoked. However, interceptors of type MessageInterceptor.TYPE_BOTH are always invoked no matter what is passed in.

Parameters:
message - the message to run interceptors on.
type - the type of the interceptor to invoke.
Throws:
MessageRejectedException

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.