org.drools
Class SessionConfiguration

java.lang.Object
  extended by org.drools.SessionConfiguration
All Implemented Interfaces:
Externalizable, Serializable, org.drools.PropertiesConfiguration, org.drools.runtime.conf.KnowledgeSessionOptionsConfiguration, org.drools.runtime.KnowledgeSessionConfiguration

public class SessionConfiguration
extends Object
implements org.drools.runtime.KnowledgeSessionConfiguration, Externalizable

SessionConfiguration A class to store Session related configuration. It must be used at session instantiation time or not used at all. This class will automatically load default values from system properties, so if you want to set a default configuration value for all your new sessions, you can simply set the property as a System property. After the Session is created, it makes the configuration immutable and there is no way to make it mutable again. This is to avoid inconsistent behavior inside session. NOTE: This API is under review and may change in the future. drools.keepReference = drools.clockType =

See Also:
Serialized Form

Constructor Summary
SessionConfiguration()
          Creates a new session configuration with default configuration options.
SessionConfiguration(ClassLoader... classLoader)
           
SessionConfiguration(Properties properties)
          Creates a new session configuration using the provided properties as configuration options.
 
Method Summary
 void addProperties(Properties properties)
           
 ClassLoader getClassLoader()
           
 ClockType getClockType()
           
 CommandService getCommandService(org.drools.KnowledgeBase kbase, org.drools.runtime.Environment environment)
           
static SessionConfiguration getDefaultInstance()
           
<T extends org.drools.runtime.conf.SingleValueKnowledgeSessionOption>
T
getOption(Class<T> option)
           
<T extends org.drools.runtime.conf.MultiValueKnowledgeSessionOption>
T
getOption(Class<T> option, String key)
           
 String getProcessInstanceManagerFactory()
           
 String getProperty(String name)
           
 org.drools.runtime.conf.QueryListenerOption getQueryListenerOption()
           
 String getSignalManagerFactory()
           
 TimerJobFactoryManager getTimerJobFactoryManager()
           
 Map<String,org.drools.runtime.process.WorkItemHandler> getWorkItemHandlers()
           
 WorkItemManagerFactory getWorkItemManagerFactory()
           
 boolean isImmutable()
          Returns true if this configuration object is immutable or false otherwise.
 boolean isKeepReference()
           
 void makeImmutable()
          Makes the configuration object immutable.
 TimerService newTimerService()
           
 void readExternal(ObjectInput in)
           
 void setClassLoader(org.drools.util.CompositeClassLoader classLoader)
           
 void setClockType(ClockType clockType)
           
 void setKeepReference(boolean keepReference)
           
<T extends org.drools.runtime.conf.KnowledgeSessionOption>
void
setOption(T option)
           
 void setProperty(String name, String value)
           
 void setTimerJobFactoryManager(TimerJobFactoryManager timerJobFactoryManager)
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionConfiguration

public SessionConfiguration(Properties properties)
Creates a new session configuration using the provided properties as configuration options.

Parameters:
properties -

SessionConfiguration

public SessionConfiguration()
Creates a new session configuration with default configuration options.


SessionConfiguration

public SessionConfiguration(ClassLoader... classLoader)
Method Detail

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

getDefaultInstance

public static SessionConfiguration getDefaultInstance()

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

getTimerJobFactoryManager

public TimerJobFactoryManager getTimerJobFactoryManager()

setTimerJobFactoryManager

public void setTimerJobFactoryManager(TimerJobFactoryManager timerJobFactoryManager)

addProperties

public void addProperties(Properties properties)

setProperty

public void setProperty(String name,
                        String value)
Specified by:
setProperty in interface org.drools.PropertiesConfiguration

getProperty

public String getProperty(String name)
Specified by:
getProperty in interface org.drools.PropertiesConfiguration

makeImmutable

public void makeImmutable()
Makes the configuration object immutable. Once it becomes immutable, there is no way to make it mutable again. This is done to keep consistency.


isImmutable

public boolean isImmutable()
Returns true if this configuration object is immutable or false otherwise.

Returns:

setKeepReference

public void setKeepReference(boolean keepReference)

isKeepReference

public boolean isKeepReference()

getClockType

public ClockType getClockType()

setClockType

public void setClockType(ClockType clockType)

getWorkItemHandlers

public Map<String,org.drools.runtime.process.WorkItemHandler> getWorkItemHandlers()

getWorkItemManagerFactory

public WorkItemManagerFactory getWorkItemManagerFactory()

getProcessInstanceManagerFactory

public String getProcessInstanceManagerFactory()

getSignalManagerFactory

public String getSignalManagerFactory()

getCommandService

public CommandService getCommandService(org.drools.KnowledgeBase kbase,
                                        org.drools.runtime.Environment environment)

newTimerService

public TimerService newTimerService()

getOption

public <T extends org.drools.runtime.conf.SingleValueKnowledgeSessionOption> T getOption(Class<T> option)
Specified by:
getOption in interface org.drools.runtime.conf.KnowledgeSessionOptionsConfiguration

getOption

public <T extends org.drools.runtime.conf.MultiValueKnowledgeSessionOption> T getOption(Class<T> option,
                                                                                        String key)
Specified by:
getOption in interface org.drools.runtime.conf.KnowledgeSessionOptionsConfiguration

setOption

public <T extends org.drools.runtime.conf.KnowledgeSessionOption> void setOption(T option)
Specified by:
setOption in interface org.drools.runtime.conf.KnowledgeSessionOptionsConfiguration

getClassLoader

public ClassLoader getClassLoader()

setClassLoader

public void setClassLoader(org.drools.util.CompositeClassLoader classLoader)

getQueryListenerOption

public org.drools.runtime.conf.QueryListenerOption getQueryListenerOption()


Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.