[JBoss AOP] - Re: JJBoss-5.0.0.Beta2 AOP problems
by vbatista
Hi!
Thanks for your reply.
Please see below my jboss-aop.xml:
<?xml version="1.0" encoding="UTF-8" ?>
aop>
aspect class="com.test.core.aop.aspects.InjectSessionBeanAspect" /
aspect class="com.test.core.aop.aspects.TestAspect" /
bind pointcut="field(* com.test.*->@com.test.core.aop.annotations.InjectSessionBean)" >
advice name="access" aspect="com.test.core.aop.aspects.InjectSessionBeanAspect" /
</bind
bind pointcut="execution(* com.test.*->@com.test.core.aop.annotations.MPlatformTest(..))" >
advice name="test" aspect="com.test.core.aop.aspects.TestAspect" /
</bind
</aop
How can I tell the "AOP Engine" to instrument only the classes on my package "com.test...."?
I think the best option will be to instrument classes at compile time. With on-the-fly instrumentation, JBoss takes the double of the time to startup. Is the re any way to diminish this time?
Thanks in advance.
Best regards,
Victor
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4113412#4113412
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4113412
18 years, 4 months
[JBossCache] - Re: TransactionTable HashMap
by mraccola
Yes, I am using two cache instances, one as a Hibernate 2nd-level cache, one as a custom application cache. I can see in the Hibernate cache (which is called from Hibernate) that although the same exact path through JBC is taken the cleanup is done in the transaction syncronization. However, this is NOT happening for my custom cache.
I have attached a JUnit test to demonstrate what I am seeing. Note that in my test the assertions at the bottom of the test (Lines 70 and 71) fail because the size of the HashMap is > 0.
What am I doing wrong?
Test Case
| package fleetcycle.model.framework.cache;
|
| import java.io.InputStream;
| import java.util.Properties;
|
| import javax.naming.Context;
| import javax.naming.InitialContext;
| import javax.transaction.UserTransaction;
|
| import junit.framework.TestCase;
|
| import org.jboss.cache.Fqn;
| import org.jboss.cache.PropertyConfigurator;
| import org.jboss.cache.TreeCache;
| import org.jboss.cache.config.Option;
|
| public class Test_CacheLeak extends TestCase
| {
|
| public void testLeak() throws Exception
| {
| final String ITEM = "item";
| TreeCache cache = new TreeCache();
| InputStream configStream = this.getClass().getResourceAsStream("/treecache-app.xml");
| PropertyConfigurator configs = new PropertyConfigurator();
| configs.configure(cache, configStream);
| cache.start();
|
| Fqn regionFqn = Fqn.fromString("/TestRegion");
|
| boolean fail = false;
| int iterationCnt = 100;
|
| Properties prop = new Properties();
| prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.cache.transaction.DummyContextFactory");
|
| for (int i = 0; i < iterationCnt; i++)
| {
| UserTransaction tx = (UserTransaction) new InitialContext(prop).lookup("UserTransaction");
| try
| {
| tx.begin();
| Option option = new Option();
| option.setFailSilently(true);
| Fqn keyFqn = new Fqn(new Object[]{regionFqn, "testRoot/testNode" + i});
| cache.put(keyFqn, ITEM, "testVal", option);
| tx.commit();
| if (fail) throw new RuntimeException();
| System.out.println("Committing");
| } catch (Throwable ex)
| {
| System.out.println("Rolling back=" + ex.getMessage());
| ex.printStackTrace();
| try
| {
| tx.rollback();
| } catch (Throwable t)
| {}
| }
| }
|
| for (int i = 0; i < iterationCnt; i++)
| {
| Fqn keyFqn = new Fqn(new Object[]{regionFqn, "testRoot/testNode" + i});
| assertNotNull("Expected cache item not found", cache.get(keyFqn, ITEM));
| }
|
| int gtxCnt = cache.getTransactionTable().getNumGlobalTransactions();
| int txCnt = cache.getTransactionTable().getNumLocalTransactions();
| assertEquals("Global transaction count is > 0", 0, gtxCnt);
| assertEquals("Local transaction count is > 0", 0, txCnt);
| }
|
| }
|
treecache-app.xml
| <?xml version="1.0" encoding="UTF-8"?>
| <server>
| <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar" />
| <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache_FCXP_app">
| <depends>jboss:service=Naming</depends>
| <depends>jboss:service=TransactionManager</depends>
|
| <attribute name="ClusterName">FCXP_app</attribute>
| <attribute name="CacheMode">LOCAL</attribute>
| <attribute name="SyncReplTimeout">10000</attribute>
| <attribute name="LockAcquisitionTimeout">15000</attribute>
| <attribute name="FetchInMemoryState">false</attribute>
| <attribute name="NodeLockingScheme">OPTIMISTIC</attribute>
| <attribute name="TransactionManagerLookupClass">org.jboss.cache.DummyTransactionManagerLookup</attribute>
| <!-- Uncomment this line for WebSphere -->
| <!-- attribute name="UseInterceptorMbeans">false</attribute -->
|
| <attribute name="EvictionPolicyConfig">
| <config>
| <attribute name="wakeUpIntervalSeconds">5</attribute>
| <!-- Cache wide default -->
| <region name="/_default_" policyClass="org.jboss.cache.eviction.LRUPolicy">
| <attribute name="maxNodes">0</attribute>
| <attribute name="timeToIdleSeconds">10000</attribute>
| </region>
| </config>
| </attribute>
| </mbean>
| </server>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4113409#4113409
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4113409
18 years, 4 months
[JBoss Seam] - Outjected variable as parameter for enhanced EL
by mahbe
Hi,
how can I get an outjected object as a call parameter for an action method in a Facelets XHTML page?
In DataTable its easy by using
| <h:dataTable id="customerlist"
| value="#{customerList}"
| var="customer">
| ...
| <h:commandLink value="#{customer.name}"
| action="#{ChooseCustomer.showDetails(customer)}"/>
| ...
|
But if I haven't got a data table, i've no idea how to do that with enhanced EL. Nested EL expressions obviously doesn't work (choosenCustomer is outjected here by @Out and present if I check it with #{choosenCustomer.name}):
| <h:commandLink id="back-customerdetails"
| value="Back to details"
| action="#{ChooseCustomer.showDetails(#{choosenCustomer})}"/>
|
And that one doesn't work, too - as expected:
| <h:commandLink id="back-customerdetails"
| value="Back to details"
| action="#{ChooseCustomer.showDetails(choosenCustomer)}"/>
|
Is there any solution with enhanced EL or am I doomed to use page parameters?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4113403#4113403
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4113403
18 years, 4 months