|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mina.statemachine.StateMachineProxyBuilder
public class StateMachineProxyBuilder
Used to create proxies which will forward all method calls on them to a
StateMachine
.
Constructor Summary | |
---|---|
StateMachineProxyBuilder()
|
Method Summary | ||
---|---|---|
Object |
create(Class<?>[] ifaces,
StateMachine sm)
Creates a proxy for the specified interfaces and which uses the specified StateMachine . |
|
|
create(Class<T> iface,
StateMachine sm)
Creates a proxy for the specified interface and which uses the specified StateMachine . |
|
StateMachineProxyBuilder |
setClassLoader(ClassLoader cl)
Sets the class loader to use for instantiating proxies. |
|
StateMachineProxyBuilder |
setEventArgumentsInterceptor(EventArgumentsInterceptor interceptor)
Sets the EventArgumentsInterceptor to be used. |
|
StateMachineProxyBuilder |
setEventFactory(EventFactory eventFactory)
Sets the EventFactory to be used. |
|
StateMachineProxyBuilder |
setIgnoreStateContextLookupFailure(boolean b)
Sets whether the failure to lookup a StateContext corresponding
to a method call on the proxy produced by this builder will raise an
exception or be silently ignored. |
|
StateMachineProxyBuilder |
setIgnoreUnhandledEvents(boolean b)
Sets whether events which have no handler in the current state will raise an exception or be silently ignored. |
|
StateMachineProxyBuilder |
setName(String name)
Sets the name of the proxy created by this builder. |
|
StateMachineProxyBuilder |
setStateContextLookup(StateContextLookup contextLookup)
Sets the StateContextLookup to be used. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StateMachineProxyBuilder()
Method Detail |
---|
public StateMachineProxyBuilder setName(String name)
toString()
method. If not specified a default
auto generated name will be used.
name
- the name.
StateMachineProxyBuilder
for method chaining.public StateMachineProxyBuilder setStateContextLookup(StateContextLookup contextLookup)
StateContextLookup
to be used. The default is to use
a SingletonStateContextLookup
.
contextLookup
- the StateContextLookup
to use.
StateMachineProxyBuilder
for method chaining.public StateMachineProxyBuilder setEventFactory(EventFactory eventFactory)
EventFactory
to be used. The default is to use a
DefaultEventFactory
.
eventFactory
- the EventFactory
to use.
StateMachineProxyBuilder
for method chaining.public StateMachineProxyBuilder setEventArgumentsInterceptor(EventArgumentsInterceptor interceptor)
EventArgumentsInterceptor
to be used. By default no
EventArgumentsInterceptor
will be used.
interceptor
- the EventArgumentsInterceptor
to use.
StateMachineProxyBuilder
for method chaining.public StateMachineProxyBuilder setIgnoreUnhandledEvents(boolean b)
b
- true
to ignore context lookup failures.
StateMachineProxyBuilder
for method chaining.public StateMachineProxyBuilder setIgnoreStateContextLookupFailure(boolean b)
StateContext
corresponding
to a method call on the proxy produced by this builder will raise an
exception or be silently ignored. The default is to raise an exception.
b
- true
to ignore context lookup failures.
StateMachineProxyBuilder
for method chaining.public StateMachineProxyBuilder setClassLoader(ClassLoader cl)
ClassLoader
as returned by
Thread.getContextClassLoader()
.
cl
- the class loader
StateMachineProxyBuilder
for method chaining.public <T> T create(Class<T> iface, StateMachine sm)
StateMachine
.
iface
- the interface the proxy will implement.sm
- the StateMachine
which will receive the events
generated by the method calls on the proxy.
public Object create(Class<?>[] ifaces, StateMachine sm)
StateMachine
.
ifaces
- the interfaces the proxy will implement.sm
- the StateMachine
which will receive the events
generated by the method calls on the proxy.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |