GigaSpaces XAP 9.5 API

org.openspaces.core.space.filter
Class AbstractFilterProviderFactoryBean

java.lang.Object
  extended by org.openspaces.core.space.filter.AbstractFilterProviderFactoryBean
All Implemented Interfaces:
FilterProviderFactory, Aware, BeanNameAware, InitializingBean
Direct Known Subclasses:
AbstractFilterProviderAdapterFactoryBean, SpaceFilterProviderFactory

public abstract class AbstractFilterProviderFactoryBean
extends Object
implements InitializingBean, BeanNameAware, FilterProviderFactory

A base factory for FilterProvider allowing to construct a filter provider that can be used to provide pre initialized ISpaceFilter implementation including its different aspects to an embedded space.

Subclasses should implement doGetFilterProvider() initializing the filter provider. All its different aspects will be initialized by this factory.

Author:
kimchy

Constructor Summary
AbstractFilterProviderFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
          Constructs the filter provider and applies its different aspects.
protected abstract  com.j_spaces.core.filters.FilterProvider doGetFilterProvider()
          Sub classes should implement this method in order to create the actual filter provider.
protected  String getBeanName()
           
protected  Object getFilter()
           
 com.j_spaces.core.filters.FilterProvider getFilterProvider()
          Returns a FilterProvider.
 void setActiveWhenBackup(boolean activeWhenBackup)
          Sets if the filter will be active when the space is in BACKUP mode.
 void setBeanName(String name)
          Sets the bean name thanks to Spring BeanNameAware.
 void setEnabled(boolean enabled)
          Is the filter enabled.
 void setFilter(Object filter)
          Sets the filter that will be used.
 void setPriority(int priority)
          The filter priority.
 void setSecurityFilter(boolean securityFilter)
          Is this filter a security filter.
 void setShutdownSpaceOnInitFailure(boolean shutdownSpaceOnInitFailure)
          Should the space shutdown in case the init method fails (throws an exception).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFilterProviderFactoryBean

public AbstractFilterProviderFactoryBean()
Method Detail

setFilter

public void setFilter(Object filter)
Sets the filter that will be used. Note, it is not an ISpaceFilter implementation since this object filter can be a delegate that does not require the filter to implement the space filter interface..


getFilter

protected Object getFilter()

setActiveWhenBackup

public void setActiveWhenBackup(boolean activeWhenBackup)
Sets if the filter will be active when the space is in BACKUP mode. Defaults to true.


setEnabled

public void setEnabled(boolean enabled)
Is the filter enabled. Defaults to true.


setSecurityFilter

public void setSecurityFilter(boolean securityFilter)
Is this filter a security filter. Defaults to false.


setShutdownSpaceOnInitFailure

public void setShutdownSpaceOnInitFailure(boolean shutdownSpaceOnInitFailure)
Should the space shutdown in case the init method fails (throws an exception). Defaults to false.


setPriority

public void setPriority(int priority)
The filter priority. Defaults to 0.


setBeanName

public void setBeanName(String name)
Sets the bean name thanks to Spring BeanNameAware. Used as the filter name.

Specified by:
setBeanName in interface BeanNameAware

getBeanName

protected String getBeanName()

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception

Constructs the filter provider and applies its different aspects. Delegates to doGetFilterProvider() for the actual filter provider creation.

Note, subclasses will need to initialize the filter provider with the relevant operation codes it will listen on.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

doGetFilterProvider

protected abstract com.j_spaces.core.filters.FilterProvider doGetFilterProvider()
                                                                         throws IllegalArgumentException
Sub classes should implement this method in order to create the actual filter provider. Note, the created filter provider will have to be initialized with at least one operation code is will listen on.

Throws:
IllegalArgumentException

getFilterProvider

public com.j_spaces.core.filters.FilterProvider getFilterProvider()
Description copied from interface: FilterProviderFactory
Returns a FilterProvider.

Specified by:
getFilterProvider in interface FilterProviderFactory

GigaSpaces XAP 9.5 API

Copyright © GigaSpaces.