[Microcontainer] - How to install a bean without affecting unrelated bean's sta
by jaikiran
Consider this case:
1) You have a MC bean (named Bean1).
2) Bean1 during its START phase (through the start() operation) wants to "install" another MC bean lets say Bean2 (which is of a completely different "type"). So Bean1 has this piece of code in its start
public void start()
{
// install Bean2
getKernel().getController().install(bean2.getBeanMetadata(),bean2Instance);
}
3) Now the important part - let's consider that the KernelController for this Kernel already has a bunch of contexts which are ready to go to START phase. So let's consider the controller has this bunch of contexts ready to got to START state - {Bean3, Bean4, Bean5}
>From what i see, when Bean1 installs Bean2 through the controller, the controller passes this context *and also the other contexts* through the various states. So during this single install operation on Bean2, the controller actually even starts incrementing the state of other contexts. So Bean3 is now moved to START state (and its start() operation is invoked).
Questions:
1) Is this API that is being used in the Bean1.start() the correct way to install a bean? I guess yes, because i could not find any other API which does a similar thing :)
2) What is the best way to install a bean without affecting the state of other *unrelated beans*. In this example, Bean2 and Bean3 are unrelated, still installing Bean2 is causing a state change in Bean3. How do i avoid this?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4219822#4219822
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4219822
17 years, 1 month
[JBoss Cache: Core Edition] - Problems deploying Cache via MicroContainer following UserGu
by angusm
I hit one or two little problems following the UserGuide to deploy the Cache. So for the benefit of anyone who follows ....
I am using JBC 3.0.3 with JBossAS 5.0.1. (I copied the jbosscache-core.jar from the release to the server/all/lib directory.)
First, contrary to what is stated in the UserGuide, the name of deployment file must end with "-jboss-beans.xml", not "-beans.xml".
The annotation entry for CacheJmsWrapper must be all on one line.
After that I hit a 'UnsupportedOperationException: Not supported in UnversionedNode' which looked suspiciously like https://jira.jboss.org/jira/browse/JBCACHE-1478. But this is reported as corrected in 3.0.3. I got round it by setting the DefaultCacheFactory boolean parameter to true.
My final "example-jboss-beans.xml" file is below.
| <?xml version="1.0" encoding="UTF-8"?>
| <deployment xmlns="urn:jboss:bean-deployer:2.0">
|
| <!-- First we create a Configuration object for the cache -->
| <bean name="ExampleCacheConfig"
| class="org.jboss.cache.config.Configuration">
|
| <!-- Externally injected services -->
| <property name="runtimeConfig">
| <bean class="org.jboss.cache.config.RuntimeConfig">
| <property name="transactionManager">
| <inject bean="jboss:service=TransactionManager"
| property="TransactionManager"/>
| </property>
| <property name="muxChannelFactory"><inject bean="JChannelFactory"/></property>
| </bean>
| </property>
|
| <property name="multiplexerStack">udp</property>
| <property name="clusterName">Example-EntityCache</property>
| <property name="isolationLevel">REPEATABLE_READ</property>
| <property name="cacheMode">REPL_SYNC</property>
| <property name="stateRetrievalTimeout">15000</property>
| <property name="syncReplTimeout">20000</property>
| <property name="lockAcquisitionTimeout">15000</property>
| <property name="exposeManagementStatistics">true</property>
| </bean>
|
| <!-- Factory to build the Cache. -->
| <bean name="DefaultCacheFactory" class="org.jboss.cache.DefaultCacheFactory">
| <constructor factoryClass="org.jboss.cache.DefaultCacheFactory"
| factoryMethod="getInstance" />
| </bean>
|
| <!-- The cache itself -->
| <bean name="ExampleCache" class="org.jboss.cache.Cache">
| <constructor factoryMethod="createCache">
| <factory bean="DefaultCacheFactory"/>
| <parameter class="org.jboss.cache.config.Configuration"><inject bean="ExampleCacheConfig"/></parameter>
| <parameter class="boolean">true</parameter>
| </constructor>
| </bean>
|
|
| <!-- JMX Management -->
| <bean name="ExampleCacheJmxWrapper" class="org.jboss.cache.jmx.CacheJmxWrapper">
| <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.cache:service=ExampleTreeCache", exposedInterface=org.jboss.cache.jmx.CacheJmxWrapperMBean.class, registerDirectly=true)</annotation>
| <constructor>
| <parameter><inject bean="ExampleCache"/></parameter>
| </constructor>
|
| </bean>
| </deployment>
| [/url]
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4219821#4219821
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4219821
17 years, 1 month
[JBoss Messaging] - NullPersistence service manager performance
by brettcave
Have just upgraded from messaging-1.4.0-SP3 to 1.4.2-SP1. The performance of 1.4.2 is significantly slower.
The following code is used:
QueueSender sender = (QueueSender) session.createProducer(queueOut);
String correlationID = message.getJMSCorrelationID();
QueueReceiver receiver = (QueueReceiver) session.createConsumer(queueIn, "JMSCorrelationID = '" + correlationID + "'");
sender.send(message, DeliveryMode.NON_PERSISTENT, priority, timeToLive);
connection.start();
result = receiver.receive(resultTimeOut);
connection.stop();
We are using a java library called stompconnect which is used as a broker for another system that picks up messages, processes and returns a response back to jms. The stompconnect environment uses jboss-remoting and jboss-messaging. The 2 libraries were updated as per the doc (using 2.2.2-SP11 of jbr and 1.4.2-sp1 of jbm). These libraries are also added to the jboss lib directory.
The following is an indication of timings (10 requests)
JBM-1.4.0-SP3 mysql-persistence: min: 17ms, max: 40ms, avg: 28ms
JBM-1.4.2-SP1 mysql-persistence: min: 24ms, max: 24ms, avg: 24ms
JBM-1.4.2-SP1 null-persistence: min: 28ms, max: 58ms, avg: 39ms
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4219808#4219808
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4219808
17 years, 1 month