|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.spicefactory.cinnamon.config.CinnamonConfig
public class CinnamonConfig
The core configuration class for Cinnamon. It serves as a central repository for registering services, service factories, class mappings, converters or interceptors. Usually an instance of this class will be created at application startup by one of the two builtin configuration mechanisms: Either loaded from an XML configuration file or loaded from a Spring ApplicationContext. But alternatively an instance of this class can also be created and configured programmatically.
| Constructor Summary | |
|---|---|
CinnamonConfig(Map<String,String> initMap,
Map<String,Object> applicationMap)
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
addConverter(Converter<?> converter)
Adds a Converter to this configuration. |
void |
addMapping(ClassMapping mapping)
Adds a class mapping. |
void |
addMessageProcessor(MessageProcessor<?,?> processor)
Adds a MessageProcessor to this configuration. |
void |
addPhaseListener(PhaseListener listener)
Adds a phase listener. |
void |
addServiceConfig(ServiceConfig serviceConfig)
Adds a Service configuration. |
void |
addServiceFactory(String factoryName,
ServiceFactory serviceFactory)
Registers a ServiceFactory instance for the given name. |
void |
addServiceInterceptor(ServiceInterceptor interceptor)
Adds an service interceptor. |
Converter<?> |
getConverter(Class<?> type)
Returns the Converter that will be applied for method parameters and bean properties of the given type. |
ClassMapping |
getMappingForAlias(String alias)
Returns the class mapping for the given alias. |
ClassMapping |
getMappingForJavaClass(Class<?> type)
Returns the class mapping for the given Java class. |
ClassMapping[] |
getMappings()
Returns an Array containing all registered class mappings. |
MessageProcessor<?,?> |
getMessageProcessor(Class<?> type)
Returns the MessageProcessor that is responsible for processing messages of the specified type. |
PhaseListener[] |
getPhaseListeners()
Returns an iterator for all registered phase listener. |
ReflectionFactory |
getReflectionFactory()
Returns the ReflectionFactory used by this instance. |
ServiceConfig |
getServiceConfig(String serviceName)
Returns the Service configuration for the given Service name. |
ServiceConfig[] |
getServiceConfigs()
Returns an Array containing all registered Service configurations. |
Map<String,ServiceFactory> |
getServiceFactories()
Returns an unmodifiable Map containing all registered ServiceFactories. |
ServiceFactory |
getServiceFactory(String factoryName)
Returns the ServiceFactory registered for the given name. |
Iterator<ServiceInterceptor> |
getServiceInterceptors()
Returns an iterator for all registered service interceptors. |
XmlAdapter |
getXmlAdapter()
Returns the XmlAdapter implementation that will be used for reading and writing XML from/to AMF3 binary data |
void |
postProcess()
Should be called once after all configuration artifacts have been added to this configuration. |
void |
setXmlAdapter(XmlAdapter adapter)
Sets the XmlAdapter implementation to be used for reading and writing XML from/to AMF3 binary data. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CinnamonConfig(Map<String,String> initMap,
Map<String,Object> applicationMap)
initMap - the initialisation parameters (taken from ServletConfig in a web application)applicationMap - the application attributes (taken from ServletContext in a web application)| Method Detail |
|---|
public ReflectionFactory getReflectionFactory()
public void addServiceFactory(String factoryName,
ServiceFactory serviceFactory)
factoryName - the name of the ServiceFactoryserviceFactory - the ServiceFactory to be addedpublic ServiceFactory getServiceFactory(String factoryName)
factoryName - the name of the ServiceFactory
public Map<String,ServiceFactory> getServiceFactories()
public void addServiceConfig(ServiceConfig serviceConfig)
serviceConfig - the Service configuration to be added to this configuration.public ServiceConfig getServiceConfig(String serviceName)
serviceName - the name of the Service
public ServiceConfig[] getServiceConfigs()
public void addServiceInterceptor(ServiceInterceptor interceptor)
interceptor - the service interceptor to be added to this configuration.public Iterator<ServiceInterceptor> getServiceInterceptors()
public void addMapping(ClassMapping mapping)
mapping - public ClassMapping getMappingForAlias(String alias)
flash.net.registerClassAlias
or the [RemoteClass] metadata tag.
alias - the alias for the mapped class
public ClassMapping getMappingForJavaClass(Class<?> type)
type - the mapped Java class
public ClassMapping[] getMappings()
public void addPhaseListener(PhaseListener listener)
listener - the phase listener to be added to this configuration.public PhaseListener[] getPhaseListeners()
public void addMessageProcessor(MessageProcessor<?,?> processor)
processor - the MessageProcessor to add to this configurationpublic MessageProcessor<?,?> getMessageProcessor(Class<?> type)
type - the type of message to return the processor for
public void addConverter(Converter<?> converter)
MyConverter implements Converter<InputStream> would be used for all method
parameters and bean properties that are declared as InputStream or a subclass of InputStream).
converter - the Converter to be added to this configuration.public Converter<?> getConverter(Class<?> type)
type - the type that the Converter will be applied to
public XmlAdapter getXmlAdapter()
public void setXmlAdapter(XmlAdapter adapter)
adapter - the XmlAdapter implementation that should be usedpublic void postProcess()
public String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||