org.jboss.cache.config
Class CustomInterceptorConfig

java.lang.Object
  extended by org.jboss.cache.config.ConfigurationComponent
      extended by org.jboss.cache.config.CustomInterceptorConfig
All Implemented Interfaces:
Serializable, Cloneable, CloneableConfigurationComponent

@Immutable
public class CustomInterceptorConfig
extends ConfigurationComponent

Holds information about the custom interceptors defined in the configuration file.

Since:
3.0
Author:
Mircea.Markus@jboss.com
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jboss.cache.config.ConfigurationComponent
log
 
Constructor Summary
CustomInterceptorConfig(CommandInterceptor interceptor)
          Constructs an interceptor config based on the supplied interceptor instance.
CustomInterceptorConfig(CommandInterceptor interceptor, boolean first, boolean last, int index, String afterClass, String beforeClass)
          Builds a custom interceptor.
 
Method Summary
 CustomInterceptorConfig clone()
           
 boolean equals(Object o)
           
 String getAfterClass()
           
 String getBeforeClass()
           
 int getIndex()
           
 CommandInterceptor getInterceptor()
          Returns a the interceptor that we want to add to the chain.
 int hashCode()
           
 boolean isFirst()
           
 boolean isLast()
           
 void setAfterClass(String afterClass)
          Adds the interceptor immediately after the first occurance of an interceptor having the given class.
 void setBeforeClass(String beforeClass)
          Adds the interceptor immediately before the first occurance of an interceptor having the given class.
 void setFirst(boolean first)
          Shall this interceptor be the first one in the chain?
 void setIndex(int index)
          Put this interceptor at the specified index, after the default chain is built.
 void setLast(boolean last)
          Shall this intercepto be the last one in the chain?
 String toString()
           
 
Methods inherited from class org.jboss.cache.config.ConfigurationComponent
addChildConfig, addChildConfigs, passCacheToChildConfig, removeChildConfig, removeChildConfigs, replaceChildConfig, replaceChildConfigs, setCache, testImmutability
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CustomInterceptorConfig

public CustomInterceptorConfig(CommandInterceptor interceptor,
                               boolean first,
                               boolean last,
                               int index,
                               String afterClass,
                               String beforeClass)
Builds a custom interceptor.

Parameters:
interceptor - interceptor instance, already initialized with all attributes specified in the configuration
first - true if you wan this to be the first interceptor in the chain
last - true if you wan this to be the last interceptor in the chain
index - an absolute position within the interceptor chain
afterClass - if you want this interceptor immediately after the specified class in the chain
beforeClass - immediately before the specified class in the chain

CustomInterceptorConfig

public CustomInterceptorConfig(CommandInterceptor interceptor)
Constructs an interceptor config based on the supplied interceptor instance.

Parameters:
interceptor -
Method Detail

setFirst

public void setFirst(boolean first)
Shall this interceptor be the first one in the chain?


setLast

public void setLast(boolean last)
Shall this intercepto be the last one in the chain?


setIndex

public void setIndex(int index)
Put this interceptor at the specified index, after the default chain is built. If the index is not valid (negative or grater than the size of the chain) an ConfigurationException is thrown at construction time.


setAfterClass

public void setAfterClass(String afterClass)
Adds the interceptor immediately after the first occurance of an interceptor having the given class. If the chain does not contain such an interceptor then this interceptor definition is ignored.


setBeforeClass

public void setBeforeClass(String beforeClass)
Adds the interceptor immediately before the first occurance of an interceptor having the given class. If the chain does not contain such an interceptor then this interceptor definition is ignored.


getInterceptor

public CommandInterceptor getInterceptor()
Returns a the interceptor that we want to add to the chain.


isFirst

public boolean isFirst()
See Also:
setFirst(boolean)

isLast

public boolean isLast()
See Also:
setLast(boolean)

getIndex

public int getIndex()
See Also:
getIndex()

getAfterClass

public String getAfterClass()
See Also:
getAfterClass()

getBeforeClass

public String getBeforeClass()
See Also:
getBeforeClass()

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

clone

public CustomInterceptorConfig clone()
                              throws CloneNotSupportedException
Specified by:
clone in interface CloneableConfigurationComponent
Overrides:
clone in class ConfigurationComponent
Throws:
CloneNotSupportedException


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.