[JBoss Cache] New message: "Re: Jboss Cache clustering in standalone mode"
by Mircea Markus
User development,
A new message was posted in the thread "Jboss Cache clustering in standalone mode":
http://community.jboss.org/message/522181#522181
Author : Mircea Markus
Profile : http://community.jboss.org/people/mircea.markus
Message:
--------------------------------------------------------------
> I have my cache application in standalone mode outside Jboss using cache version caynene, I have to 2 unix boxes where I want to start one instance of the cache application. Now, I want these two to join these two cache instance to join the same cluster, so that they can replicate. Can I do that with out using JBoss cluster, using some configuration files and required binaries like jgroups?
>
Yes, JBossCache is a general purpose clustering library and it can form clusters outside AS. I suggest you take at the available JBoss Cache documentation: http://www.jboss.org/file-access/default/members/jbosscache/freezone/docs...
> Also, I have 2 instances of JBoss EAP 5.0 running on these unix boxes started in clustering mode. But the cache application as stated above is hosted outside the JBoss. Do I need yo use the JBoss servers and their cluster to get these two standalone caches yo replicate in same cluster?
>
no, you don't need that. Even more, I don't reckon joining the JBoss AS cluster is an good idea, as that would interfere with AS clustering.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/522181#522181
16 years, 3 months
[jBPM] New message: "Best way to extend Tasks in 4.3?"
by Gregg Freeman
User development,
A new message was posted in the thread "Best way to extend Tasks in 4.3?":
http://community.jboss.org/message/522178#522178
Author : Gregg Freeman
Profile : http://community.jboss.org/people/gfreeman
Message:
--------------------------------------------------------------
I've been looking at this for about a day, and still can't come up with a decent solution. Hopefully someone can point me in the right direction.
I'd like to extend the behavior of the TaskActivity so that the new implementation can:
1. Notify the task candiates that a new task has been created.
2. Optionally immediately transition out of the activity without creating tasks (or notifying), based on a boolean process variable.
The closest I came was a custom user binding in jbpm.user.bindings.xml that would return my Extended Task Activity. That would work great, except that:
* The custom tag in the jpdl (<extended-task>) gives validation errors in the xml within the process editor.
* The boxes no longer show up in the graphical process editor.
I think I can get the email sent with a custom listener on the task, since it looks like the Start event (and listeners) are exeucted after the activity execute.
So, I'm still stuck with how to figuring out how to supply an alternate Activity Behavior for the task. Am I stuck with having to use a custom task and supplying getters and setters for the same configuration data I'd supply on a task activity?
Has anyone else done anything similar?
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/522178#522178
16 years, 3 months
[jBPM] Document updated/added: "JBPM 4.3 - Best way to extend the Task Activity"
by Gregg Freeman
User development,
The document "JBPM 4.3 - Best way to extend the Task Activity", was updated Jan 25, 2010
by Gregg Freeman.
To view the document, visit:
http://community.jboss.org/docs/DOC-14676#cf
Document:
--------------------------------------------------------------
I've been looking at this for about a day, and still can't come up with a decent solution. Hopefully someone can point me in the right direction.
I'd like to extend the behavior of the TaskActivity so that the new implementation can:
1. Notify the task candiates that a new task has been created.
2. Optionally immediately transition out of the activity without creating tasks (or notifying), based on a boolean process variable.
The closest I came was a custom user binding in jbpm.user.bindings.xml that would return my Extended Task Activity. That would work great, except that:
* The custom tag in the jpdl (<extended-task>) gives validation errors in the xml within the process editor.
* The boxes no longer show up in the graphical process editor.
I think I can get the email sent with a custom listener on the task, since it looks like the Start event (and listeners) are exeucted after the activity execute.
So, I'm still stuck with how to figuring out how to supply an alternate Activity Behavior for the task. Am I stuck with having to use a custom task and supplying getters and setters for the same configuration data I'd supply on a task activity?
Has anyone else done anything similar?
--------------------------------------------------------------
16 years, 3 months
[JBoss Microcontainer] New message: "Lookup up a POJO service without injecting it inside -beans.xml?"
by Martin N
User development,
A new message was posted in the thread "Lookup up a POJO service without injecting it inside -beans.xml?":
http://community.jboss.org/message/522176#522176
Author : Martin N
Profile : http://community.jboss.org/people/MartinN
Message:
--------------------------------------------------------------
I need to be able to look up a POJO deployed service on JBoss 5's MC, but I do not know how to obtain a reference to the kernel so I can obtain a ControllerContext.
My onIy constraint is I can not modify the interface of the service where I need to lookup the POJO service (or else I could just inject it straight up via the -bean.xml descriptor). The look up would work exactly as JNDI would - but why do JNDI if I can somehow directly access the JBoss MC kernel?
Can someone point me to an example on how to do this, or is this even possible?
I did find Ales Justin's mc-int utility that looks up the kernel inside a servlet given a "ServletContext" as input. I need something exactly like this.
Am I missing something really obvious here because it looks to me like there should be some easy way of doing this .
Sorry - I've been doing JMX and jboss 4.2.3 for a long time and am sorta new to this paradigm..
Thanks!
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/522176#522176
16 years, 3 months
[JBoss AOP] New message: "Client Interceptor for EJB3"
by Karl Koster
User development,
A new message was posted in the thread "Client Interceptor for EJB3":
http://community.jboss.org/message/522166#522166
Author : Karl Koster
Profile : http://community.jboss.org/people/kkoster
Message:
--------------------------------------------------------------
I am trying to deploy a pair of client and server side interceptors for EJB3. I am using JBoss 5.1.0.GA. I have followed the directions found at http://www.jboss.org/ejb3/docs/tutorial/configuration/configuration.html. The interceptors are packaged in the EAR for the application. I first altered the ejb-intercetpors-aop.xml to create new customized stacks with the following additions (existing content is removed for brevity):
<!-- KDR Additions -->
<interceptor class="org.kdr.interceptor.security.KDRClientSecurityInterceptor" scope="PER_VM"/>
<interceptor class="org.kdr.interceptor.security.KDRServerSecurityInterceptor" scope="PER_VM"/>
<!-- End KDR Additions -->
<!-- KDR Additions -->
<stack name="KDRServiceClientInterceptors">
<interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.security.client.SecurityClientInterceptor"/>
<interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
<interceptor-ref name="org.kdr.interceptor.security.KDRClientSecurityInterceptor"/>
<interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
</stack>
<stack name="KDRStatelessSessionClientInterceptors">
<interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.security.client.SecurityClientInterceptor"/>
<interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
<interceptor-ref name="org.kdr.interceptor.security.KDRClientSecurityInterceptor"/>
<interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
</stack>
<stack name="KDRStatefulSessionClientInterceptors">
<interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.security.client.SecurityClientInterceptor"/>
<interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
<interceptor-ref name="org.kdr.interceptor.security.KDRClientSecurityInterceptor"/>
<interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
</stack>
<stack name="KDRClusteredStatelessSessionClientInterceptors">
<interceptor-ref name="org.jboss.ejb3.remoting.ClusteredIsLocalInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.security.client.SecurityClientInterceptor"/>
<interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
<interceptor-ref name="org.jboss.aspects.remoting.ClusterChooserInterceptor"/>
<interceptor-ref name="org.kdr.interceptor.security.KDRClientSecurityInterceptor"/>
<interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
</stack>
<stack name="KDRClusteredStatefulSessionClientInterceptors">
<interceptor-ref name="org.jboss.ejb3.remoting.ClusteredIsLocalInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.security.client.SecurityClientInterceptor"/>
<interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
<interceptor-ref name="org.jboss.aspects.remoting.ClusterChooserInterceptor"/>
<interceptor-ref name="org.kdr.interceptor.security.KDRClientSecurityInterceptor"/>
<interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
</stack>
<!-- End KDR Additions -->
I also added the following entries for the server side interceptor (copies of the existing domains with the addition of the custom server side interceptor):
<!-- KDR Additions -->
<domain name="KDR Stateless Bean" extends="Intercepted Bean" inheritBindings="true">
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
</bind>
<bind pointcut="execution(public * @org.jboss.ejb3.annotation.SecurityDomain->*(..))">
<interceptor-ref name="Basic Authorization"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
</bind>
<bind pointcut="execution(public * @org.jboss.ejb3.annotation.Clustered->*(..))">
<interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.kdr.interceptor.security.KDRServerSecurityInterceptor"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.tx.CMTTxInterceptorFactory"/>
<interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.tx.BMTTxInterceptorFactory"/>
<interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
<!-- interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/ -->
<stack-ref name="EJBInterceptors"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.kdr.interceptor.security.KDRServerSecurityInterceptor"/>
</bind>
<annotation expr="class(*) AND !class((a)org.jboss.ejb3.annotation.Pool)">
@org.jboss.ejb3.annotation.Pool (value="ThreadlocalPool", maxSize=30, timeout=10000)
</annotation>
</domain>
<domain name="KDR JACC Stateless Bean" extends="Intercepted Bean" inheritBindings="true">
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
</bind>
<bind pointcut="execution(public * @org.jboss.ejb3.annotation.SecurityDomain->*(..))">
<interceptor-ref name="JACC Authorization"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
</bind>
<bind pointcut="execution(public * @org.jboss.ejb3.annotation.Clustered->*(..))">
<interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.kdr.interceptor.security.KDRServerSecurityInterceptor"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.tx.CMTTxInterceptorFactory"/>
<interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.tx.BMTTxInterceptorFactory"/>
<interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
<!-- interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/ -->
<stack-ref name="EJBInterceptors"/>
</bind>
<annotation expr="class(*) AND !class((a)org.jboss.ejb3.annotation.Pool)">
@org.jboss.ejb3.annotation.Pool (value="ThreadlocalPool", maxSize=30, timeout=10000)
</annotation>
</domain>
<domain name="KDR Base Stateful Bean" extends="Intercepted Bean" inheritBindings="true">
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
</bind>
<bind pointcut="execution(public * @org.jboss.ejb3.annotation.SecurityDomain->*(..))">
<interceptor-ref name="Basic Authorization"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
</bind>
<bind pointcut="execution(public * @org.jboss.ejb3.annotation.Clustered->*(..))">
<interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.tx.CMTTxInterceptorFactory"/>
</bind>
<bind pointcut="execution(public * *->@javax.ejb.Remove(..))">
<interceptor-ref name="org.jboss.ejb3.stateful.StatefulRemoveFactory"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.jboss.ejb3.stateful.StatefulInstanceInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.tx.BMTTxInterceptorFactory"/>
<interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
</bind>
<bind pointcut="execution(public * $instanceof{javax.ejb.SessionSynchronization}->*(..))">
<interceptor-ref name="org.jboss.ejb3.stateful.SessionSynchronizationInterceptor"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.kdr.interceptor.security.KDRServerSecurityInterceptor"/>
</bind>
<bind pointcut="execution(public * @org.jboss.ejb3.annotation.Clustered->*(..)) AND !execution(public * *->@javax.ejb.Remove(..))">
<interceptor-ref name="org.jboss.ejb3.cache.StatefulReplicationInterceptor"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<!-- interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/ -->
<stack-ref name="EJBInterceptors"/>
</bind>
<annotation expr="class(*) AND !class((a)org.jboss.ejb3.annotation.Pool)">
@org.jboss.ejb3.annotation.Pool (value="ThreadlocalPool", maxSize=30, timeout=10000)
</annotation>
</domain>
<domain name="KDR Stateful Bean" extends="KDR Base Stateful Bean" inheritBindings="true">
<!-- NON Clustered cache configuration -->
<annotation expr="class(*) AND !class((a)org.jboss.ejb3.annotation.Cache) AND !class((a)org.jboss.ejb3.annotation.Clustered)">
@org.jboss.ejb3.annotation.Cache ("SimpleStatefulCache")
</annotation>
<annotation expr="class(*) AND !class((a)org.jboss.ejb3.annotation.PersistenceManager) AND !class((a)org.jboss.ejb3.annotation.Clustered)">
@org.jboss.ejb3.annotation.PersistenceManager ("StatefulSessionFilePersistenceManager")
</annotation>
<annotation expr="class(*) AND !class((a)org.jboss.ejb3.annotation.CacheConfig) AND !class((a)org.jboss.ejb3.annotation.Clustered)">
@org.jboss.ejb3.annotation.CacheConfig (maxSize=100000, idleTimeoutSeconds=300, removalTimeoutSeconds=0)
</annotation>
<!-- Clustered cache configuration -->
<annotation expr="class(*) AND !class((a)org.jboss.ejb3.annotation.Cache) AND class((a)org.jboss.ejb3.annotation.Clustered)">
@org.jboss.ejb3.annotation.Cache ("StatefulTreeCache")
</annotation>
<annotation expr="class(*) AND !class((a)org.jboss.ejb3.annotation.CacheConfig) AND class((a)org.jboss.ejb3.annotation.Clustered)">
@org.jboss.ejb3.annotation.CacheConfig (name="sfsb-cache", maxSize=100000, idleTimeoutSeconds=300, removalTimeoutSeconds=0)
</annotation>
</domain>
<domain name="KDR JACC Stateful Bean" extends="Intercepted Bean" inheritBindings="true">
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
</bind>
<bind pointcut="execution(public * @org.jboss.ejb3.annotation.SecurityDomain->*(..))">
<interceptor-ref name="JACC Authorization"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
</bind>
<bind pointcut="execution(public * @org.jboss.ejb3.annotation.Clustered->*(..))">
<interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.tx.CMTTxInterceptorFactory"/>
</bind>
<bind pointcut="execution(public * *->@javax.ejb.Remove(..))">
<interceptor-ref name="org.jboss.ejb3.stateful.StatefulRemoveFactory"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.jboss.ejb3.stateful.StatefulInstanceInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.tx.BMTTxInterceptorFactory"/>
<interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
</bind>
<bind pointcut="execution(public * $instanceof{javax.ejb.SessionSynchronization}->*(..))">
<interceptor-ref name="org.jboss.ejb3.stateful.SessionSynchronizationInterceptor"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.kdr.interceptor.security.KDRServerSecurityInterceptor"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor"/>
<!-- interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/ -->
<stack-ref name="EJBInterceptors"/>
</bind>
<bind pointcut="execution(public * @org.jboss.ejb3.annotation.Clustered->*(..)) AND !execution(public * *->@javax.ejb.Remove(..))">
<interceptor-ref name="org.jboss.ejb3.cache.StatefulReplicationInterceptor"/>
</bind>
<annotation expr="class(*) AND !class((a)org.jboss.ejb3.annotation.Pool)">
@org.jboss.ejb3.annotation.Pool (value="ThreadlocalPool", maxSize=30, timeout=10000)
</annotation>
<!-- NON Clustered cache configuration -->
<annotation expr="class(*) AND !class((a)org.jboss.ejb3.annotation.Cache) AND !class((a)org.jboss.ejb3.annotation.Clustered)">
@org.jboss.ejb3.annotation.Cache ("SimpleStatefulCache")
</annotation>
<annotation expr="class(*) AND !class((a)org.jboss.ejb3.annotation.PersistenceManager) AND !class((a)org.jboss.ejb3.annotation.Clustered)">
@org.jboss.ejb3.annotation.PersistenceManager ("StatefulSessionFilePersistenceManager")
</annotation>
<annotation expr="class(*) AND !class((a)org.jboss.ejb3.annotation.CacheConfig) AND !class((a)org.jboss.ejb3.annotation.Clustered)">
@org.jboss.ejb3.annotation.CacheConfig (maxSize=100000, idleTimeoutSeconds=300, removalTimeoutSeconds=0)
</annotation>
<!-- Clustered cache configuration -->
<annotation expr="class(*) AND !class((a)org.jboss.ejb3.annotation.Cache) AND class((a)org.jboss.ejb3.annotation.Clustered)">
@org.jboss.ejb3.annotation.Cache ("StatefulTreeCache")
</annotation>
<annotation expr="class(*) AND !class((a)org.jboss.ejb3.annotation.CacheConfig) AND class((a)org.jboss.ejb3.annotation.Clustered)">
@org.jboss.ejb3.annotation.CacheConfig (name="sfsb-cache", maxSize=100000, idleTimeoutSeconds=300, removalTimeoutSeconds=0)
</annotation>
</domain>
<domain name="KDR Embedded Stateful Bean" extends="KDR Base Stateful Bean" inheritBindings="true">
<!-- NON Clustered cache configuration -->
<annotation expr="class(*) AND !class((a)org.jboss.ejb3.annotation.Cache)">
@org.jboss.ejb3.annotation.Cache ("NoPassivationCache")
</annotation>
</domain>
<domain name="KDR Message Driven Bean" extends="Intercepted Bean" inheritBindings="true">
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
<interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.kdr.interceptor.security.KDRServerSecurityInterceptor"/>
</bind>
<!-- TODO: Authorization? -->
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.jboss.ejb3.tx.CMTTxInterceptorFactory"/>
<interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.tx.BMTTxInterceptorFactory"/>
<interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
<!-- interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/ -->
<stack-ref name="EJBInterceptors"/>
</bind>
<annotation expr="class(*) AND !class((a)org.jboss.ejb3.annotation.Pool)">
@org.jboss.ejb3.annotation.Pool (value="StrictMaxPool", maxSize=15, timeout=10000)
</annotation>
</domain>
<domain name="KDR Consumer Bean" extends="Intercepted Bean" inheritBindings="true">
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.jboss.ejb3.tx.CMTTxInterceptorFactory"/>
<interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.tx.BMTTxInterceptorFactory"/>
<interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
</bind>
<bind pointcut="execution(public * *->*(..)) AND (has(* *->@org.jboss.ejb3.annotation.CurrentMessage(..)) OR hasfield(* *->@org.jboss.ejb3.annotation.CurrentMessage))">
<interceptor-ref name="org.jboss.ejb3.mdb.CurrentMessageInjectorInterceptorFactory"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.kdr.interceptor.security.KDRServerSecurityInterceptor"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<!-- interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/ -->
<stack-ref name="EJBInterceptors"/>
</bind>
<annotation expr="class(*) AND !class((a)org.jboss.ejb3.annotation.Pool)">
@org.jboss.ejb3.annotation.Pool (value="StrictMaxPool", maxSize=15, timeout=10000)
</annotation>
</domain>
<domain name="KDR Service Bean" extends="Intercepted Bean" inheritBindings="true">
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
</bind>
<bind pointcut="!execution(* *->create()) AND !execution(* *->start()) AND !execution(*->new(..)) AND !execution(* *->stop()) AND !execution(* *->destroy())">
<interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
</bind>
<bind pointcut="execution(public * @org.jboss.ejb3.annotation.SecurityDomain->*(..)) AND !execution(* *->create()) AND !execution(* *->start()) AND !execution(* *->stop()) AND !execution(* *->destroy())">
<interceptor-ref name="Basic Authorization"/>
</bind>
<bind pointcut="execution(public * *->*(..)) AND !execution(* *->create()) AND !execution(* *->start()) AND !execution(* *->stop()) AND !execution(* *->destroy())">
<interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.kdr.interceptor.security.KDRServerSecurityInterceptor"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.tx.CMTTxInterceptorFactory"/>
<interceptor-ref name="org.jboss.ejb3.tx.BMTTxInterceptorFactory"/>
<interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
</bind>
<bind pointcut="execution(public * *->*(..)) AND !execution(* *->create()) AND !execution(* *->start()) AND !execution(* *->stop())">
<!-- interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/ -->
<stack-ref name="EJBInterceptors"/>
</bind>
</domain>
<domain name="KDR JACC Service Bean" extends="Intercepted Bean" inheritBindings="true">
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
</bind>
<bind pointcut="!execution(* *->create()) AND !execution(* *->start()) AND !execution(*->new(..)) AND !execution(* *->stop()) AND !execution(* *->destroy())">
<interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
</bind>
<bind pointcut="execution(public * @org.jboss.ejb3.annotation.SecurityDomain->*(..)) AND !execution(* *->create()) AND !execution(* *->start()) AND !execution(* *->stop()) AND !execution(* *->destroy())">
<interceptor-ref name="Basic Authorization"/>
</bind>
<bind pointcut="execution(public * *->*(..)) AND !execution(* *->create()) AND !execution(* *->start()) AND !execution(* *->destroy())">
<interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.kdr.interceptor.security.KDRServerSecurityInterceptor"/>
</bind>
<bind pointcut="execution(public * *->*(..))">
<interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.tx.CMTTxInterceptorFactory"/>
<interceptor-ref name="org.jboss.ejb3.tx.BMTTxInterceptorFactory"/>
<interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
<interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
</bind>
<bind pointcut="execution(public * *->*(..)) AND !execution(* *->create()) AND !execution(* *->start())">
<!-- interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/ -->
<stack-ref name="EJBInterceptors"/>
</bind>
</domain>
<!-- End KDR Additions -->
The client side interceptor:
import java.io.Serializable;
import org.apache.commons.discovery.tools.DiscoverSingleton;
import org.jboss.aop.advice.Interceptor;
import org.jboss.aop.joinpoint.Invocation;
import org.jboss.aop.util.PayloadKey;
import org.kdr.resource.ResourceCache;
import org.kdr.security.SecurityUtils;
import org.kdr.security.user.UserContext;
public class KDRClientSecurityInterceptor implements Interceptor, Serializable {
private static final long serialVersionUID = 1L;
public String getName() {
return getClass().getSimpleName();
}
public Object invoke(Invocation invocation) throws Throwable {
ResourceCache cache = (ResourceCache) DiscoverSingleton
.find(ResourceCache.class);
UserContext context = (UserContext) cache
.getResource(SecurityUtils.USER_CTX_KEY);
invocation.getMetaData().addMetaData("KDR", SecurityUtils.USER_CTX_KEY, //$NON-NLS-1$
context.getName(), PayloadKey.AS_IS);
return invocation.invokeNext();
}
}
The server side interceptor:
import java.io.Serializable;
import org.jboss.aop.advice.Interceptor;
import org.jboss.aop.joinpoint.Invocation;
import org.kdr.security.SecurityUtils;
public class KDRServerSecurityInterceptor implements Interceptor, Serializable {
private static final long serialVersionUID = 1L;
public String getName() {
return getClass().getSimpleName();
}
public Object invoke(Invocation invocation) throws Throwable {
String name = (String) invocation.getMetaData("KDR", //$NON-NLS-1$
SecurityUtils.USER_CTX_KEY);
SecurityToken.setUserContextName(name);
return invocation.invokeNext();
}
}
I am testing this out on an existing SLSB that contains the following annotations:
@Stateless
@Clustered(loadBalancePolicy = "org.jboss.ha.client.loadbalance.RandomRobin", partition = "KDR")
@Local( { LocationManagementLocal.class })
@LocalBinding(jndiBinding = "kdr/local/LocationManagement")
@Remote( { LocationManagementRemote.class })
@RemoteBinding(interceptorStack = "KDRClusteredStatelessSessionClientInterceptors", jndiBinding = "kdr/remote/LocationManagement")
@AspectDomain("KDR Stateless Bean")
public class LocationManagementBean implements LocationManagementLocal,
LocationManagementRemote, Serializable {
On the first attempt, it seems that the custom client interceptor stack's binding is being ignored by JBoss. When I inspected it on the proxy in the client it contained the ClusteredStatelessSessionClientInterceptors stack.The server side configuration worked with the new configuration.
I then copied the interceptor-ref for the custom interceptor to that stack and had no difficulties. Is this a known issue? I would prefer to create a custom client side interceptor stack so I don't interfere with anything deployed that is not associated with my application.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/522166#522166
16 years, 3 months
[JNDI and Naming] New message: "Re: Name lookup fails, reason unknown"
by Peter Johnson
User development,
A new message was posted in the thread "Name lookup fails, reason unknown":
http://community.jboss.org/message/522160#522160
Author : Peter Johnson
Profile : http://community.jboss.org/people/peterj
Message:
--------------------------------------------------------------
*"I am contracting with a client and so client confidentiality prevents me from posting actual code or details of the app "*
I have no problem with obfuscated code, providing that the obfuscated code mimics tha patterns in the actual code. An obfuscated JNDI name pattern is still much more enlightening than a variable whose contents I can only guess at.
One thing has me confused. There is this statement: "The name being looked up is "<myapp>/<myfacade>/remote" But later you give this code:
@EJB(beanName=<a name>)
private xyzManager xyzSession;
How does xyzSession relate to "<myapp>/<myfacade>/remote", or is it something completely different? If completely different, why mention it? If is is the same, why is it not:
@EJB(beanName=<a name>)
private <myfacade> xyzSession;
Alos ,the reference object looks OK - it would appear to be a referencefor a "ProxyFactory/myapp/myfacade/myapp/myfacade/remote" which seems to indicate that if you cast it to myfacade you should be OK. That is verififed by this info:
Type: Remote Business Interface
Content: <package>.interfaces.myfacade
* "(1) The remote interface class extends all of the other bean interfaces so it is a super remote to all of the other bean interfaces."*
I wonder is this is causing the problem. Which interfaces have the @Remote annotation?
* "The console log showed a couple of warnings:"*
I don't think that the warnings have anything to do with this particular problem - as long as the name shows up in the JNDI tree, you should be able to look up the EJB. Of course, you might run into issues later with accessing entity beans.
Where does the client live - the one that is looking up the EJB?
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/522160#522160
16 years, 3 months