[jboss-svn-commits] JBL Code SVN: r5455 - in labs/jbossesb/branches/ejb3/product: core/common/src/org/jboss/soa/esb/services core/common/tests core/common/tests/resources core/common/tests/resources/conf core/common/tests/src/org/jboss/soa/esb/common/tests core/processors/src/org/jboss/soa/esb/processors core/services/src/org/jboss/soa/esb/services core/services/src/org/jboss/soa/esb/services/EJB core/services/tests/src/org/jboss/soa/esb/services core/services/tests/src/org/jboss/soa/esb/services/EJB core/services/tests/src/org/jboss/soa/esb/services/EJB/test core/services/tests/src/org/jboss/soa/esb/services/tests lib/ext
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Aug 3 20:09:19 EDT 2006
Author: kurt.stam at jboss.com
Date: 2006-08-03 20:03:47 -0400 (Thu, 03 Aug 2006)
New Revision: 5455
Added:
labs/jbossesb/branches/ejb3/product/core/common/tests/resources/
labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/
labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/default.persistence.properties
labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/ejb3-interceptors-aop.xml
labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/embedded-jboss-beans.xml
labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/jboss-jms-beans.xml
labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/log4j.xml
labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/login-config.xml
labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/security-beans.xml
labs/jbossesb/branches/ejb3/product/core/common/tests/src/org/jboss/soa/esb/common/tests/EJBContainerSetup.java
labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/
labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/
labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/NotificationFuncTest.java
labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/NotificationTest.java
labs/jbossesb/branches/ejb3/product/lib/ext/hibernate-all.jar
labs/jbossesb/branches/ejb3/product/lib/ext/jboss-ejb3-all.jar
labs/jbossesb/branches/ejb3/product/lib/ext/thirdparty-all.jar
Removed:
labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/NotificationFuncTest.java
labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/tests/notification/
Modified:
labs/jbossesb/branches/ejb3/product/core/common/src/org/jboss/soa/esb/services/IbatchHandler.java
labs/jbossesb/branches/ejb3/product/core/common/src/org/jboss/soa/esb/services/IpersistHandler.java
labs/jbossesb/branches/ejb3/product/core/processors/src/org/jboss/soa/esb/processors/AbstractProcessor.java
labs/jbossesb/branches/ejb3/product/core/processors/src/org/jboss/soa/esb/processors/FileProcessor.java
labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/BatchHandlerBsDelegateLocal.java
labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/BatchHandlerBsDelegateRemote.java
labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/BatchHandlerFactory.java
labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/EJB/BatchHandler.java
labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/EJB/BatchHandlerBean.java
labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/NotifHandlerBsDelegateLocal.java
labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/NotifHandlerBsDelegateRemote.java
labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/NotificationHandlerFactory.java
labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/PersistHandlerBsDelegateLocal.java
labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/PersistHandlerBsDelegateRemote.java
labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/PersistHandlerFactory.java
Log:
Adding ejb3 support
Modified: labs/jbossesb/branches/ejb3/product/core/common/src/org/jboss/soa/esb/services/IbatchHandler.java
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/common/src/org/jboss/soa/esb/services/IbatchHandler.java 2006-08-03 21:30:57 UTC (rev 5454)
+++ labs/jbossesb/branches/ejb3/product/core/common/src/org/jboss/soa/esb/services/IbatchHandler.java 2006-08-04 00:03:47 UTC (rev 5455)
@@ -31,6 +31,5 @@
public long newBatch () throws Exception;
public int addToBatch (String p_s) throws Exception;
public void finish () throws Exception;
- public void releaseHandler();
public void commitBatch(BatchProcess p_oBP) throws Exception;
} //____________________________________________________________________________
Modified: labs/jbossesb/branches/ejb3/product/core/common/src/org/jboss/soa/esb/services/IpersistHandler.java
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/common/src/org/jboss/soa/esb/services/IpersistHandler.java 2006-08-03 21:30:57 UTC (rev 5454)
+++ labs/jbossesb/branches/ejb3/product/core/common/src/org/jboss/soa/esb/services/IpersistHandler.java 2006-08-04 00:03:47 UTC (rev 5455)
@@ -35,5 +35,4 @@
public BaseBusinessObject getObject(Class p_oCls,long p_lUid) throws Exception;
public void rplObject(BaseBusinessObject p_o) throws Exception;
public void rmvObject(Class p_oCls,long p_lUid) throws Exception;
- public void remove() throws Exception;
} //____________________________________________________________________________
Added: labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/default.persistence.properties
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/default.persistence.properties 2006-08-03 21:30:57 UTC (rev 5454)
+++ labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/default.persistence.properties 2006-08-04 00:03:47 UTC (rev 5455)
@@ -0,0 +1,17 @@
+hibernate.transaction.manager_lookup_class=org.hibernate.transaction.JBossTransactionManagerLookup
+#hibernate.connection.release_mode=after_statement
+#hibernate.transaction.flush_before_completion=false
+#hibernate.transaction.auto_close_session=false
+#hibernate.query.factory_class=org.hibernate.hql.ast.ASTQueryTranslatorFactory
+#hibernate.hbm2ddl.auto=create-drop
+#hibernate.hbm2ddl.auto=create
+hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
+# Clustered cache with TreeCache
+#hibernate.cache.provider_class=org.jboss.ejb3.entity.TreeCacheProviderHook
+#hibernate.treecache.mbean.object_name=jboss.cache:service=EJB3EntityTreeCache
+#hibernate.dialect=org.hibernate.dialect.HSQLDialect
+hibernate.jndi.java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+hibernate.jndi.java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+hibernate.bytecode.use_reflection_optimizer=false
+# I don't think this is honored, but EJB3Deployer uses it
+hibernate.bytecode.provider=javassist
\ No newline at end of file
Added: labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/ejb3-interceptors-aop.xml
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/ejb3-interceptors-aop.xml 2006-08-03 21:30:57 UTC (rev 5454)
+++ labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/ejb3-interceptors-aop.xml 2006-08-04 00:03:47 UTC (rev 5455)
@@ -0,0 +1,376 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE aop PUBLIC
+ "-//JBoss//DTD JBOSS AOP 1.0//EN"
+ "http://www.jboss.org/aop/dtd/jboss-aop_1_0.dtd">
+
+<aop>
+ <interceptor class="org.jboss.aspects.remoting.InvokeRemoteInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.aspects.security.SecurityClientInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.aspects.tx.ClientTxPropagationInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.ejb3.remoting.IsLocalInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.aspects.remoting.ClusterChooserInterceptor" scope="PER_VM"/>
+
+ <interceptor class="org.jboss.aspects.tx.TxPropagationInterceptor" scope="PER_VM"/>
+
+ <stack name="ServiceClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <stack name="AsynchronousStatelessSessionClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <stack name="AsynchronousStatefulSessionClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <stack name="StatelessSessionClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <stack name="StatefulSessionClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <stack name="ClusteredStatelessSessionClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.ClusterChooserInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <stack name="ClusteredStatefulSessionClientInterceptors">
+ <interceptor-ref name="org.jboss.ejb3.remoting.IsLocalInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.security.SecurityClientInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.ClientTxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.ClusterChooserInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.remoting.InvokeRemoteInterceptor"/>
+ </stack>
+
+ <interceptor class="org.jboss.ejb3.asynchronous.AsynchronousInterceptor" scope="PER_CLASS"/>
+ <interceptor class="org.jboss.ejb3.ENCPropagationInterceptor" scope="PER_VM"/>
+ <interceptor name="Basic Authorization" factory="org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorFactory" scope="PER_CLASS"/>
+ <interceptor name="JACC Authorization" factory="org.jboss.ejb3.security.JaccAuthorizationInterceptorFactory" scope="PER_CLASS"/>
+ <interceptor factory="org.jboss.ejb3.security.AuthenticationInterceptorFactory" scope="PER_CLASS"/>
+ <interceptor factory="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory" scope="PER_CLASS"/>
+ <interceptor class="org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.ejb3.stateless.StatelessInstanceInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.ejb3.stateful.StatefulInstanceInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.ejb3.stateful.SessionSynchronizationInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.ejb3.service.ServiceSingletonInterceptor" scope="PER_VM"/>
+ <interceptor class="org.jboss.ejb3.cache.StatefulReplicationInterceptor" scope="PER_VM"/>
+ <interceptor factory="org.jboss.ejb3.stateful.StatefulRemoveFactory" scope="PER_CLASS_JOINPOINT"/>
+ <interceptor factory="org.jboss.ejb3.tx.TxInterceptorFactory" scope="PER_CLASS_JOINPOINT"/>
+ <interceptor factory="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory" scope="PER_CLASS_JOINPOINT"/>
+ <interceptor factory="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory" scope="PER_CLASS"/>
+ <interceptor class="org.jboss.ejb3.AllowedOperationsInterceptor" scope="PER_VM"/>
+ <interceptor factory="org.jboss.ejb3.mdb.CurrentMessageInjectorInterceptorFactory" scope="PER_CLASS"/>
+ <interceptor class="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor" scope="PER_VM"/>
+
+ <domain name="Stateless Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
+ <interceptor-ref name="Basic Authorization"/>
+ </bind>
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+ <annotation expr="!class(@org.jboss.annotation.ejb.PoolClass)">
+ @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000)
+ </annotation>
+ </domain>
+
+ <domain name="JACC Stateless Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
+ <interceptor-ref name="JACC Authorization"/>
+ </bind>
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+ <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+ <annotation expr="!class(@org.jboss.annotation.ejb.PoolClass)">
+ @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000)
+ </annotation>
+ </domain>
+
+ <domain name="Base Stateful Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
+ <interceptor-ref name="Basic Authorization"/>
+ </bind>
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
+ </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.aspects.tx.TxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <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"/>
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+
+ <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..)) AND !execution(public * *->@javax.ejb.Remove(..))">
+ <interceptor-ref name="org.jboss.ejb3.cache.StatefulReplicationInterceptor"/>
+ </bind>
+ <annotation expr="!class(@org.jboss.annotation.ejb.PoolClass)">
+ @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000)
+ </annotation>
+ </domain>
+
+ <domain name="Stateful Bean" extends="Base Stateful Bean" inheritBindings="true">
+ <!-- NON Clustered cache configuration -->
+ <annotation expr="!class(@org.jboss.annotation.ejb.cache.Cache) AND !class(@org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.simple.SimpleStatefulCache.class)
+ </annotation>
+ <annotation expr="!class(@org.jboss.annotation.ejb.cache.simple.PersistenceManager) AND !class(@org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.simple.PersistenceManager (org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.class)
+ </annotation>
+ <annotation expr="!class(@org.jboss.annotation.ejb.cache.simple.CacheConfig) AND !class(@org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.simple.CacheConfig (maxSize=100000, idleTimeoutSeconds=300)
+ </annotation>
+
+ <!-- Clustered cache configuration -->
+ <annotation expr="!class(@org.jboss.annotation.ejb.cache.Cache) AND class(@org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.tree.StatefulTreeCache.class)
+ </annotation>
+ <annotation expr="!class(@org.jboss.annotation.ejb.cache.tree.CacheConfig) AND class(@org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.tree.CacheConfig (name="jboss.cache:service=EJB3SFSBClusteredCache", maxSize=100000, idleTimeoutSeconds=300)
+ </annotation>
+ </domain>
+
+ <domain name="JACC Stateful Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
+ <interceptor-ref name="JACC Authorization"/>
+ </bind>
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
+ </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.aspects.tx.TxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <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"/>
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+
+ <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..)) AND !execution(public * *->@javax.ejb.Remove(..))">
+ <interceptor-ref name="org.jboss.ejb3.cache.StatefulReplicationInterceptor"/>
+ </bind>
+ <annotation expr="!class(@org.jboss.annotation.ejb.PoolClass)">
+ @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000)
+ </annotation>
+
+ <!-- NON Clustered cache configuration -->
+ <annotation expr="!class(@org.jboss.annotation.ejb.cache.Cache) AND !class(@org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.simple.SimpleStatefulCache.class)
+ </annotation>
+ <annotation expr="!class(@org.jboss.annotation.ejb.cache.simple.PersistenceManager) AND !class(@org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.simple.PersistenceManager (org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.class)
+ </annotation>
+ <annotation expr="!class(@org.jboss.annotation.ejb.cache.simple.CacheConfig) AND !class(@org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.simple.CacheConfig (maxSize=100000, idleTimeoutSeconds=300)
+ </annotation>
+
+ <!-- Clustered cache configuration -->
+ <annotation expr="!class(@org.jboss.annotation.ejb.cache.Cache) AND class(@org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.tree.StatefulTreeCache.class)
+ </annotation>
+ <annotation expr="!class(@org.jboss.annotation.ejb.cache.tree.CacheConfig) AND class(@org.jboss.annotation.ejb.Clustered)">
+ @org.jboss.annotation.ejb.cache.tree.CacheConfig (name="jboss.cache:service=EJB3SFSBClusteredCache", maxSize=100000, idleTimeoutSeconds=300)
+ </annotation>
+ </domain>
+
+ <domain name="Embedded Stateful Bean" extends="Base Stateful Bean" inheritBindings="true">
+ <!-- NON Clustered cache configuration -->
+ <annotation expr="!class(@org.jboss.annotation.ejb.cache.Cache)">
+ @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.NoPassivationCache.class)
+ </annotation>
+
+ </domain>
+
+ <domain name="Message Driven Bean">
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+ <annotation expr="!class(@org.jboss.annotation.ejb.PoolClass)">
+ @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000)
+ </annotation>
+ </domain>
+
+ <domain name="Message Inflow Driven Bean">
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+ <annotation expr="!class(@org.jboss.annotation.ejb.PoolClass)">
+ @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000)
+ </annotation>
+ </domain>
+
+ <domain name="Consumer Bean">
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..)) AND (has(* *->@org.jboss.annotation.ejb.CurrentMessage(..)) OR hasfield(* *->@org.jboss.annotation.ejb.CurrentMessage))">
+ <interceptor-ref name="org.jboss.ejb3.mdb.CurrentMessageInjectorInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+ </bind>
+ <annotation expr="!class(@org.jboss.annotation.ejb.PoolClass)">
+ @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000)
+ </annotation>
+ </domain>
+
+ <domain name="Service Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+ </bind>
+ <bind pointcut="!execution(* *->create()) AND !execution(* *->start()) AND !execution(*->new(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
+ <interceptor-ref name="Basic Authorization"/>
+ </bind>
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <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"/>
+ </bind>
+ </domain>
+
+ <domain name="JACC Service Bean">
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+ </bind>
+ <bind pointcut="!execution(* *->create()) AND !execution(* *->start()) AND !execution(*->new(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
+ <interceptor-ref name="Basic Authorization"/>
+ </bind>
+ <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+ <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+ </bind>
+ <bind pointcut="execution(public * *->*(..))">
+ <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+ <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+ <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"/>
+ </bind>
+ </domain>
+
+
+</aop>
\ No newline at end of file
Added: labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/embedded-jboss-beans.xml
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/embedded-jboss-beans.xml 2006-08-03 21:30:57 UTC (rev 5454)
+++ labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/embedded-jboss-beans.xml 2006-08-04 00:03:47 UTC (rev 5455)
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
+ xmlns="urn:jboss:bean-deployer">
+ <bean name="Naming" class="org.jnp.server.SingletonNamingServer"/>
+
+ <bean name="InitialContextProperties" class="java.util.Hashtable">
+ <constructor>
+ <parameter class="java.util.Map">
+ <map keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>java.naming.factory.initial</key>
+ <value>org.jnp.interfaces.LocalOnlyContextFactory</value>
+ </entry>
+ <entry>
+ <key>java.naming.factory.url.pkgs</key>
+ <value>org.jboss.naming:org.jnp.interfaces</value>
+ </entry>
+ </map>
+ </parameter>
+ </constructor>
+ </bean>
+
+ <bean name="java:comp/Initializer" class="org.jboss.ejb3.embedded.JavaCompInitializer">
+ <property name="jndiProperties"><inject bean="InitialContextProperties"/></property>
+ </bean>
+
+ <bean name="XidFactory" class="org.jboss.tm.XidFactoryImpl"/>
+
+ <bean name="XidFactoryMBean" class="org.jboss.ejb3.embedded.XidFactoryMBean">
+ <constructor>
+ <parameter class="org.jboss.tm.XidFactoryBase">
+ <inject bean="XidFactory"/>
+ </parameter>
+ </constructor>
+ </bean>
+
+ <bean name="TransactionManagerInitializer" class="org.jboss.tm.TransactionManagerInitializer">
+ <property name="xidFactory"><inject bean="XidFactory"/></property>
+ <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
+ </bean>
+
+ <bean name="UserTransaction" class="org.jboss.ejb3.embedded.UserTransactionImpl">
+ <demand>TransactionManagerInitializer</demand>
+ </bean>
+
+ <bean name="UserTransactionBinding" class="org.jboss.ejb3.embedded.JndiBinder">
+ <property name="jndiProperties"><inject bean="InitialContextProperties"/></property>
+ <property name="target"><inject bean="UserTransaction"/></property>
+ <property name="bindTo">UserTransaction</property>
+ <property name="serializable">false</property>
+ </bean>
+
+
+ <bean name="TransactionManager" class="java.lang.Object">
+ <constructor factoryMethod="getTransactionManager">
+ <factory bean="TransactionManagerInitializer"/>
+ </constructor>
+ </bean>
+ <bean name="CachedConnectionManager" class="org.jboss.resource.connectionmanager.CachedConnectionManagerReference">
+ <property name="transactionManager"><inject bean="TransactionManager"/></property>
+ </bean>
+
+ <!--
+ <bean class="org.jboss.jdbc.HypersonicDatabase"
+ name="jboss:service=Hypersonic,database=localDB">
+ <property name="database">localDB</property>
+ <property name="inProcessMode">true</property>
+ <property name="dbDataDir">.</property>
+ </bean>
+ -->
+
+ <bean name="DefaultDSBootstrap" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
+ <property name="driverClass">org.hsqldb.jdbcDriver</property>
+ <property name="connectionURL">jdbc:hsqldb:.</property>
+ <!-- <property name="connectionURL">jdbc:hsqldb:./hypersonic/localDB</property> -->
+ <property name="userName">sa</property>
+ <property name="jndiName">java:/DefaultDS</property>
+ <property name="minSize">0</property>
+ <property name="maxSize">10</property>
+ <property name="blockingTimeout">1000</property>
+ <property name="idleTimeout">100000</property>
+ <property name="transactionManager"><inject bean="TransactionManager"/></property>
+ <property name="cachedConnectionManager"><inject bean="CachedConnectionManager"/></property>
+ <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
+ </bean>
+
+ <bean name="DefaultDS" class="java.lang.Object">
+ <constructor factoryMethod="getDatasource">
+ <factory bean="DefaultDSBootstrap"/>
+ </constructor>
+ </bean>
+
+
+</deployment>
\ No newline at end of file
Added: labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/jboss-jms-beans.xml
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/jboss-jms-beans.xml 2006-08-03 21:30:57 UTC (rev 5454)
+++ labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/jboss-jms-beans.xml 2006-08-04 00:03:47 UTC (rev 5455)
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
+ xmlns="urn:jboss:bean-deployer">
+ <bean name="jboss.mq:service=JMSProviderLoader,name=JMSProvider" class="org.jboss.jms.jndi.JNDIProviderAdapter">
+ <property name="factoryRef">java:/XAConnectionFactory</property>
+ <property name="queueFactoryRef">java:/XAConnectionFactory</property>
+ <property name="topicFactoryRef">java:/XAConnectionFactory</property>
+ <property name="properties" class="java.util.Properties">
+ <map keyClass="java.lang.String" valueClass="java.lang.String">
+ <entry>
+ <key>java.naming.factory.initial</key>
+ <value>org.jnp.interfaces.LocalOnlyContextFactory</value>
+ </entry>
+ <entry>
+ <key>java.naming.factory.url.pkgs</key>
+ <value>org.jboss.naming:org.jnp.interfaces</value>
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+ <bean name="b1" class="org.jboss.ejb3.embedded.JndiBinder">
+ <property name="jndiProperties"><inject bean="InitialContextProperties"/></property>
+ <property name="target"><inject bean="jboss.mq:service=JMSProviderLoader,name=JMSProvider"/></property>
+ <property name="bindTo">java:/DefaultJMSProvider</property>
+ <property name="serializable">true</property>
+ </bean>
+
+ <bean name="jboss.mq:service=ServerSessionPoolMBean,name=StdJMSPool" class="org.jboss.jms.asf.StdServerSessionPoolFactory">
+ <property name="name">StdJMSPool</property>
+ <property name="xidFactory"><inject bean="XidFactoryMBean"/></property>
+ <property name="transactionManager"><inject bean="TransactionManager"/></property>
+ </bean>
+
+ <bean name="b2" class="org.jboss.ejb3.embedded.JndiBinder">
+ <property name="jndiProperties"><inject bean="InitialContextProperties"/></property>
+ <property name="target"><inject bean="jboss.mq:service=ServerSessionPoolMBean,name=StdJMSPool"/></property>
+ <property name="bindTo">java:/StdJMSPool</property>
+ <property name="serializable">false</property>
+ </bean>
+
+
+ <bean name="jboss.mq:service=PersistenceManager" class="org.jboss.mq.kernel.JDBC2PersistenceManager">
+ <property name="transactionManager">
+ <inject bean="TransactionManager"/>
+ </property>
+ <property name="datasource">
+ <inject bean="DefaultDS"/>
+ </property>
+ <property name="sqlProperties">
+
+ BLOB_TYPE=OBJECT_BLOB
+ INSERT_TX = INSERT INTO JMS_TRANSACTIONS (TXID) values(?)
+ INSERT_MESSAGE = INSERT INTO JMS_MESSAGES (MESSAGEID, DESTINATION, MESSAGEBLOB, TXID, TXOP) VALUES(?,?,?,?,?)
+ SELECT_ALL_UNCOMMITED_TXS = SELECT TXID FROM JMS_TRANSACTIONS
+ SELECT_MAX_TX = SELECT MAX(TXID) FROM JMS_MESSAGES
+ SELECT_MESSAGES_IN_DEST = SELECT MESSAGEID, MESSAGEBLOB FROM JMS_MESSAGES WHERE DESTINATION=?
+ SELECT_MESSAGE = SELECT MESSAGEID, MESSAGEBLOB FROM JMS_MESSAGES WHERE MESSAGEID=? AND DESTINATION=?
+ MARK_MESSAGE = UPDATE JMS_MESSAGES SET TXID=?, TXOP=? WHERE MESSAGEID=? AND DESTINATION=?
+ UPDATE_MESSAGE = UPDATE JMS_MESSAGES SET MESSAGEBLOB=? WHERE MESSAGEID=? AND DESTINATION=?
+ UPDATE_MARKED_MESSAGES = UPDATE JMS_MESSAGES SET TXID=?, TXOP=? WHERE TXOP=?
+ UPDATE_MARKED_MESSAGES_WITH_TX = UPDATE JMS_MESSAGES SET TXID=?, TXOP=? WHERE TXOP=? AND TXID=?
+ DELETE_MARKED_MESSAGES_WITH_TX = DELETE FROM JMS_MESSAGES WHERE TXOP=? AND JMS_MESSAGES.TXID IN (SELECT TXID FROM JMS_TRANSACTIONS)
+ DELETE_TX = DELETE FROM JMS_TRANSACTIONS WHERE TXID = ?
+ DELETE_MARKED_MESSAGES = DELETE FROM JMS_MESSAGES WHERE TXID=? AND TXOP=?
+ DELETE_MESSAGE = DELETE FROM JMS_MESSAGES WHERE MESSAGEID=? AND DESTINATION=?
+ CREATE_MESSAGE_TABLE = CREATE CACHED TABLE JMS_MESSAGES ( MESSAGEID INTEGER NOT NULL, \
+ DESTINATION VARCHAR(255) NOT NULL, TXID INTEGER, TXOP CHAR(1), \
+ MESSAGEBLOB OBJECT, PRIMARY KEY (MESSAGEID, DESTINATION) )
+ CREATE_IDX_MESSAGE_TXOP_TXID = CREATE INDEX JMS_MESSAGES_TXOP_TXID ON JMS_MESSAGES (TXOP, TXID)
+ CREATE_IDX_MESSAGE_DESTINATION = CREATE INDEX JMS_MESSAGES_DESTINATION ON JMS_MESSAGES (DESTINATION)
+ CREATE_TX_TABLE = CREATE CACHED TABLE JMS_TRANSACTIONS ( TXID INTEGER, PRIMARY KEY (TXID) )
+ CREATE_TABLES_ON_STARTUP = TRUE
+ DELETE_TEMPORARY_MESSAGES = DELETE FROM JMS_MESSAGES WHERE TXOP='T'
+
+ </property>
+ </bean>
+
+ <bean name="jboss.mq:service=MessageCache" class="org.jboss.mq.kernel.MessageCache">
+ <property name="persistenceManager"><inject bean="jboss.mq:service=PersistenceManager"/></property>
+ <property name="highMemoryMark">50</property>
+ <property name="maxMemoryMark">60</property>
+ </bean>
+
+ <bean name="jboss.mq:service=StateManager" class="org.jboss.mq.kernel.JDBCStateManager">
+ <property name="transactionManager">
+ <inject bean="TransactionManager"/>
+ </property>
+ <property name="datasource">
+ <inject bean="DefaultDS"/>
+ </property>
+ <property name="sqlProperties">
+
+ CREATE_TABLES_ON_STARTUP = TRUE
+ CREATE_USER_TABLE = CREATE TABLE JMS_USERS (USERID VARCHAR(32) NOT NULL, PASSWD VARCHAR(32) NOT NULL, \
+ CLIENTID VARCHAR(128), PRIMARY KEY(USERID))
+ CREATE_ROLE_TABLE = CREATE TABLE JMS_ROLES (ROLEID VARCHAR(32) NOT NULL, USERID VARCHAR(32) NOT NULL, \
+ PRIMARY KEY(USERID, ROLEID))
+ CREATE_SUBSCRIPTION_TABLE = CREATE TABLE JMS_SUBSCRIPTIONS (CLIENTID VARCHAR(128) NOT NULL, \
+ SUBNAME VARCHAR(128) NOT NULL, TOPIC VARCHAR(255) NOT NULL, \
+ SELECTOR VARCHAR(255), PRIMARY KEY(CLIENTID, SUBNAME))
+ GET_SUBSCRIPTION = SELECT TOPIC, SELECTOR FROM JMS_SUBSCRIPTIONS WHERE CLIENTID=? AND SUBNAME=?
+ LOCK_SUBSCRIPTION = SELECT TOPIC, SELECTOR FROM JMS_SUBSCRIPTIONS WHERE CLIENTID=? AND SUBNAME=?
+ GET_SUBSCRIPTIONS_FOR_TOPIC = SELECT CLIENTID, SUBNAME, SELECTOR FROM JMS_SUBSCRIPTIONS WHERE TOPIC=?
+ INSERT_SUBSCRIPTION = INSERT INTO JMS_SUBSCRIPTIONS (CLIENTID, SUBNAME, TOPIC, SELECTOR) VALUES(?,?,?,?)
+ UPDATE_SUBSCRIPTION = UPDATE JMS_SUBSCRIPTIONS SET TOPIC=?, SELECTOR=? WHERE CLIENTID=? AND SUBNAME=?
+ REMOVE_SUBSCRIPTION = DELETE FROM JMS_SUBSCRIPTIONS WHERE CLIENTID=? AND SUBNAME=?
+ GET_USER_BY_CLIENTID = SELECT USERID, PASSWD, CLIENTID FROM JMS_USERS WHERE CLIENTID=?
+ GET_USER = SELECT PASSWD, CLIENTID FROM JMS_USERS WHERE USERID=?
+ POPULATE.TABLES.01 = INSERT INTO JMS_USERS (USERID, PASSWD) VALUES ('guest', 'guest')
+ POPULATE.TABLES.02 = INSERT INTO JMS_USERS (USERID, PASSWD) VALUES ('j2ee', 'j2ee')
+ POPULATE.TABLES.03 = INSERT INTO JMS_USERS (USERID, PASSWD, CLIENTID) VALUES ('john', 'needle', 'DurableSubscriberExample')
+ POPULATE.TABLES.04 = INSERT INTO JMS_USERS (USERID, PASSWD) VALUES ('nobody', 'nobody')
+ POPULATE.TABLES.05 = INSERT INTO JMS_USERS (USERID, PASSWD) VALUES ('dynsub', 'dynsub')
+ POPULATE.TABLES.06 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('guest','guest')
+ POPULATE.TABLES.07 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('j2ee','guest')
+ POPULATE.TABLES.08 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('john','guest')
+ POPULATE.TABLES.09 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('subscriber','john')
+ POPULATE.TABLES.10 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('publisher','john')
+ POPULATE.TABLES.11 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('publisher','dynsub')
+ POPULATE.TABLES.12 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('durpublisher','john')
+ POPULATE.TABLES.13 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('durpublisher','dynsub')
+ POPULATE.TABLES.14 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('noacc','nobody')
+
+ </property>
+ </bean>
+
+
+ <bean name="BasicQueueParameters" class="org.jboss.mq.server.BasicQueueParameters"/>
+
+ <bean name="jboss.mq:service=ThreadPool" class="org.jboss.util.threadpool.BasicThreadPool">
+ <property name="name">JMSThread</property>
+ <property name="threadGroupName">JBossMQ Server Threads</property>
+ <!-- The max number of threads in the pool -->
+ <property name="maximumPoolSize">10</property>
+ <!-- The max number of tasks before the queue is full -->
+ <property name="maximumQueueSize">1000</property>
+ <!-- The behavior of the pool when a task is added and the queue is full.
+ abort - a RuntimeException is thrown
+ run - the calling thread executes the task
+ wait - the calling thread blocks until the queue has room
+ discard - the task is silently discarded without being run
+ discardOldest - check to see if a task is about to complete and enque
+ the new task if possible, else run the task in the calling thread
+ -->
+ <property name="blockingModeString">run</property>
+ </bean>
+
+ <bean name="jboss.mq:service=DestinationManager" class="org.jboss.mq.server.JMSDestinationManager">
+ <constructor>
+ <parameter class="org.jboss.mq.server.BasicQueueParameters">
+ <inject bean="BasicQueueParameters"/>
+ </parameter>
+ </constructor>
+ <property name="persistenceManager"><inject bean="jboss.mq:service=PersistenceManager"/></property>
+ <property name="messageCache"><inject bean="jboss.mq:service=MessageCache"/></property>
+ <property name="stateManager"><inject bean="jboss.mq:service=StateManager"/></property>
+ <property name="threadPool"><inject bean="jboss.mq:service=ThreadPool"/></property>
+ <property name="threadGroup"><inject bean="jboss.mq:service=ThreadPool" property="threadGroup"/></property>
+ <start method="startServer"/>
+ <stop method="stopServer"/>
+ </bean>
+
+ <bean name="jboss.mq.destination:service=Queue,name=DLQ" class="org.jboss.mq.kernel.Queue">
+ <property name="destinationManagerPojo"><inject bean="jboss.mq:service=DestinationManager"/></property>
+ <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
+ <property name="destinationName">DLQ</property>
+ </bean>
+
+ <bean name="jboss.mq:service=Invoker" class="org.jboss.mq.server.JMSServerInvoker">
+ <property name="next"><inject bean="jboss.mq:service=DestinationManager"/></property>
+ </bean>
+
+ <bean name="jboss.mq:service=InvocationLayer,type=JVM" class="org.jboss.mq.kernel.JVMIL">
+ <property name="jmsInvoker"><inject bean="jboss.mq:service=Invoker"/></property>
+ <property name="connectionFactoryJNDIRef">java:/ConnectionFactory</property>
+ <property name="xAConnectionFactoryJNDIRef">java:/XAConnectionFactory</property>
+ <property name="pingPeriod">0</property>
+ <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
+ </bean>
+
+</deployment>
\ No newline at end of file
Added: labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/log4j.xml
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/log4j.xml 2006-08-03 21:30:57 UTC (rev 5454)
+++ labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/log4j.xml 2006-08-04 00:03:47 UTC (rev 5455)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.1 2006/01/12 02:44:08 bill Exp $ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Target" value="System.out"/>
+ <param name="Threshold" value="INFO"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Messagen -->
+ <!--
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+ -->
+ <param name="ConversionPattern" value="%-5p %d{dd-MM HH:mm:ss,SSS} (%F:%M:%L) -%m%n"/>
+ </layout>
+</appender>
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ </root>
+
+</log4j:configuration>
Added: labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/login-config.xml
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/login-config.xml 2006-08-03 21:30:57 UTC (rev 5454)
+++ labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/login-config.xml 2006-08-04 00:03:47 UTC (rev 5455)
@@ -0,0 +1,63 @@
+<?xml version='1.0'?>
+
+<!DOCTYPE policy PUBLIC
+ "-//JBoss//DTD JBOSS Security Config 3.0//EN"
+ "http://www.jboss.org/j2ee/dtd/security_config.dtd">
+
+<!-- The XML based JAAS login configuration read by the
+org.jboss.security.auth.login.XMLLoginConfig mbean. Add
+an application-policy element for each security domain.
+
+The outline of the application-policy is:
+<application-policy name="security-domain-name">
+ <authentication>
+ <login-module code="login.module1.class.name" flag="control_flag">
+ <module-option name = "option1-name">option1-value</module-option>
+ <module-option name = "option2-name">option2-value</module-option>
+ ...
+ </login-module>
+
+ <login-module code="login.module2.class.name" flag="control_flag">
+ ...
+ </login-module>
+ ...
+ </authentication>
+</application-policy>
+
+$Revision: 1.1 $
+-->
+
+<policy>
+ <!-- Used by clients within the application server VM such as
+ mbeans and servlets that access EJBs.
+ -->
+ <application-policy name="client-login">
+ <authentication>
+ <login-module code="org.jboss.security.ClientLoginModule"
+ flag="required">
+ <!-- Any existing security context will be restored on logout -->
+ <module-option name="restore-login-identity">true</module-option>
+ </login-module>
+ </authentication>
+ </application-policy>
+
+ <application-policy name="other">
+ <!-- A simple server login module, which can be used when the number
+ of users is relatively small. It uses two properties files:
+ users.properties, which holds users (key) and their password (value).
+ roles.properties, which holds users (key) and a comma-separated list of
+ their roles (value).
+ The unauthenticatedIdentity property defines the name of the principal
+ that will be used when a null username and password are presented as is
+ the case for an unuathenticated web client or MDB. If you want to
+ allow such users to be authenticated add the property, e.g.,
+ unauthenticatedIdentity="nobody"
+ -->
+ <authentication>
+ <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
+ flag="required"/>
+ </authentication>
+ </application-policy>
+
+</policy>
+
Added: labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/security-beans.xml
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/security-beans.xml 2006-08-03 21:30:57 UTC (rev 5454)
+++ labs/jbossesb/branches/ejb3/product/core/common/tests/resources/conf/security-beans.xml 2006-08-04 00:03:47 UTC (rev 5455)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
+ xmlns="urn:jboss:bean-deployer">
+
+ <bean class="org.jboss.ejb3.embedded.JaasSecurityManagerService"
+ name="jboss.security:service=JaasSecurityManager">
+ <property name="initialContextProperties">
+ <inject bean="InitialContextProperties"/>
+ </property>
+ </bean>
+</deployment>
Added: labs/jbossesb/branches/ejb3/product/core/common/tests/src/org/jboss/soa/esb/common/tests/EJBContainerSetup.java
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/common/tests/src/org/jboss/soa/esb/common/tests/EJBContainerSetup.java 2006-08-03 21:30:57 UTC (rev 5454)
+++ labs/jbossesb/branches/ejb3/product/core/common/tests/src/org/jboss/soa/esb/common/tests/EJBContainerSetup.java 2006-08-04 00:03:47 UTC (rev 5455)
@@ -0,0 +1,163 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.common.tests;
+
+/**
+ * Special Setup class to invoke the JBoss microcontainer for testing ejb
+ * code. Based a class provided by John Gilbert.
+ *
+ * @author kstam
+ */
+import java.util.Properties;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NameClassPair;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+
+import org.apache.log4j.Logger;
+import org.jboss.ejb3.embedded.EJB3StandaloneBootstrap;
+
+public class EJBContainerSetup extends TestSetup {
+
+ private static final Logger log = Logger.getLogger(EJBContainerSetup.class);
+
+ private static InitialContext initialContext;
+
+ private static boolean initialized = false;
+
+ public EJBContainerSetup(Test test) {
+ super(test);
+ }
+
+ protected void setUp() {
+ startupEmbeddedJboss();
+ }
+
+ protected void tearDown() {
+ // shutdownEmbeddedJboss();
+ }
+
+ public static void shutdownEmbeddedJboss() {
+ EJB3StandaloneBootstrap.shutdown();
+ }
+
+ public static void startupEmbeddedJboss() {
+ try {
+ if (initialized)
+ return;
+
+ // TODO should not have to do this....
+ System.setProperty(
+ "javax.security.jacc.PolicyConfigurationFactory.provider",
+ "org.jboss.security.jacc.JBossPolicyConfigurationFactory");
+
+ // Boot the JBoss Microcontainer with EJB3 settings, loads
+ // ejb3-interceptors-aop.xml
+ EJB3StandaloneBootstrap.boot(null);
+
+ // Deploy CaveatEmptor beans (datasource, mostly)
+ EJB3StandaloneBootstrap.deployXmlResource("jboss-jms-beans.xml");
+ //EJB3StandaloneBootstrap.deployXmlResource("ejb3-deployment.xml");
+ EJB3StandaloneBootstrap.deployXmlResource("security-beans.xml");
+ log.info("scanClasspath: "
+ + System.getProperty("java.class.path"));
+ EJB3StandaloneBootstrap.scanClasspath();
+
+ // Create InitialContext from jndi.properties
+ System.setProperty("java.naming.factory.initial",
+ "org.jnp.interfaces.LocalOnlyContextFactory");
+ System.setProperty("java.naming.factory.url.pkgs",
+ "org.jboss.naming:org.jnp.interfaces");
+ initialContext = new InitialContext();
+
+ printJndiTree();
+
+ initialized = true;
+
+ } catch (Exception ex) {
+ log.error("EJB3 Container Startup Error", ex);
+ throw new RuntimeException(ex);
+ }
+ }
+
+ static private void printJndiTree() throws Exception {
+
+ log.info("JNDI Tree");
+ NamingEnumeration e = initialContext.list("");
+ while (e.hasMore()) {
+ NameClassPair element = (NameClassPair) e.next();
+ print(element, "");
+ }
+ e = initialContext.list("java:");
+ while (e.hasMore()) {
+ NameClassPair element = (NameClassPair) e.next();
+ print(element, "");
+ }
+ }
+
+ static private void print(NameClassPair ctx, String tab) {
+ log.info(tab + ctx);
+ try {
+ NamingEnumeration e = initialContext.list(ctx.getName());
+ while (e.hasMore()) {
+ NameClassPair element = (NameClassPair) e.next();
+ print(element, tab + "--> ");
+ }
+ } catch (NamingException e1) {
+ }
+ }
+
+ public static Object lookup(String beanName) {
+ try {
+ return initialContext.lookup(beanName);
+ } catch (NamingException ex) {
+ throw new RuntimeException("Couldn't lookup: " + beanName, ex);
+ }
+ }
+
+ public static Object lookup(String beanName, String user, String password) {
+ InitialContext ctx = null;
+ try {
+ Properties env = new Properties();
+ env.setProperty(Context.SECURITY_PRINCIPAL, user);
+ env.setProperty(Context.SECURITY_CREDENTIALS, password);
+ env.setProperty(Context.INITIAL_CONTEXT_FACTORY,
+ "org.jboss.security.jndi.JndiLoginInitialContextFactory");
+ ctx = new InitialContext(env);
+
+ return ctx.lookup(beanName);
+ } catch (NamingException ex) {
+ throw new RuntimeException("Couldn't lookup: " + beanName, ex);
+ } finally {
+ try {
+ ctx.close();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+}
Modified: labs/jbossesb/branches/ejb3/product/core/processors/src/org/jboss/soa/esb/processors/AbstractProcessor.java
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/processors/src/org/jboss/soa/esb/processors/AbstractProcessor.java 2006-08-03 21:30:57 UTC (rev 5454)
+++ labs/jbossesb/branches/ejb3/product/core/processors/src/org/jboss/soa/esb/processors/AbstractProcessor.java 2006-08-04 00:03:47 UTC (rev 5455)
@@ -192,12 +192,6 @@
replaceMacros(oaChilds[i1]);
}//_________________________
- protected void release()
- { switch (getOutputType())
- { case TYP_BATCHER: getBatcher().release(); break;
- }
- } //__________________________________
-
protected void finish(BatchProcess p_oBP) throws Exception
{
switch (getOutputType())
@@ -359,11 +353,6 @@
return getBatchHandler().addToBatch(p_o.toString());
} //________________________________
- private void release()
- { try {m_oBHandler.releaseHandler(); }
- catch (Exception e) {}
- } //________________________________
-
private void finish() throws Exception
{ m_olNum = null;
m_oBHandler.finish();
Modified: labs/jbossesb/branches/ejb3/product/core/processors/src/org/jboss/soa/esb/processors/FileProcessor.java
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/processors/src/org/jboss/soa/esb/processors/FileProcessor.java 2006-08-03 21:30:57 UTC (rev 5454)
+++ labs/jbossesb/branches/ejb3/product/core/processors/src/org/jboss/soa/esb/processors/FileProcessor.java 2006-08-04 00:03:47 UTC (rev 5455)
@@ -96,9 +96,7 @@
m_oLogger.fatal("Input File processor FAILED",e);
throw e;
}
- finally
- { super.release();
- }
+
}
catch (Exception eGen)
{
Modified: labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/BatchHandlerBsDelegateLocal.java
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/BatchHandlerBsDelegateLocal.java 2006-08-03 21:30:57 UTC (rev 5454)
+++ labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/BatchHandlerBsDelegateLocal.java 2006-08-04 00:03:47 UTC (rev 5455)
@@ -19,48 +19,39 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-
-
package org.jboss.soa.esb.services;
-import javax.naming.*;
+import javax.naming.Context;
-import org.jboss.soa.esb.services.EJB.*;
import org.jboss.soa.esb.common.bizclasses.BatchProcess;
+import org.jboss.soa.esb.services.EJB.BatchHandler;
public class BatchHandlerBsDelegateLocal implements IbatchHandler
{
- //KS private BatchHandlerLocal m_oBatchH;
+ private BatchHandler m_oBatchH;
- public BatchHandlerBsDelegateLocal(Context p_ctx) throws Exception
- {
- Object ref = p_ctx.lookup("BatchHandlerLocal");
+ public BatchHandlerBsDelegateLocal(Context p_ctx) throws Exception
+ {
+ m_oBatchH = (BatchHandler) p_ctx.lookup("NotificationHandlerBean/local");
+ }
-// KS BatchHandlerLocalHome oHu = (BatchHandlerLocalHome) ref;
-// KS m_oBatchH = oHu.create();
- } //__________________________________
+ public long newBatch() throws Exception
+ {
+ return m_oBatchH.newBatch();
+ }
- public long newBatch () throws Exception
- { return 0;
- //KS m_oBatchH.newBatch();
- }
+ public int addToBatch(String p_s) throws Exception
+ {
+ return m_oBatchH.addToBatch(p_s);
+ }
- public int addToBatch (String p_s) throws Exception
- { return 0;
- //KS m_oBatchH.addToBatch(p_s);
- }
+ public void finish() throws Exception
+ {
+ m_oBatchH.finish();
+ }
- public void finish () throws Exception
- { //KS m_oBatchH.finish();
-
- }
-
- public void releaseHandler()
- { try { //KS m_oBatchH.remove();
- }
- catch (Exception e) {}
- } //__________________________________
- public void commitBatch(BatchProcess p_oBP) throws Exception
- { //KS m_oBatchH.commitBatch(p_oBP);
- } //__________________________________
-} //____________________________________________________________________________
+ public void commitBatch(BatchProcess p_oBP) throws Exception
+ {
+ m_oBatchH.commitBatch(p_oBP.toDTO());
+ }
+}
Modified: labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/BatchHandlerBsDelegateRemote.java
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/BatchHandlerBsDelegateRemote.java 2006-08-03 21:30:57 UTC (rev 5454)
+++ labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/BatchHandlerBsDelegateRemote.java 2006-08-04 00:03:47 UTC (rev 5455)
@@ -24,38 +24,32 @@
package org.jboss.soa.esb.services;
import javax.naming.*;
-import javax.rmi.*;
import org.jboss.soa.esb.services.EJB.*;
import org.jboss.soa.esb.common.bizclasses.BatchProcess;
public class BatchHandlerBsDelegateRemote implements IbatchHandler
{
- private BatchHandler m_oBatchH;
+ private BatchHandler m_oBatchH;
- public BatchHandlerBsDelegateRemote(Context p_ctx) throws Exception
- {
- Object ref = p_ctx.lookup("BatchHandler");
- //KS Object oNarr = PortableRemoteObject.narrow(ref, BatchHandlerHome.class);
- //KS BatchHandlerHome oHu = (BatchHandlerHome) oNarr;
- //KS m_oBatchH = oHu.create();
- } //__________________________________
+ public BatchHandlerBsDelegateRemote(Context p_ctx) throws Exception {
+ m_oBatchH = (BatchHandler) p_ctx
+ .lookup("NotificationHandlerBean/remote");
+ }
- public long newBatch () throws Exception
- { return 0; //KS m_oBatchH.newBatch();
- }
- public int addToBatch (String p_s) throws Exception
- { return 0; //KS m_oBatchH.addToBatch(p_s);
- }
- public void finish () throws Exception
- { m_oBatchH.finish(); }
- public void releaseHandler()
- { try {
- //KS m_oBatchH.remove();
- }
- catch (Exception e) {}
- } //__________________________________
- public void commitBatch(BatchProcess p_oBP) throws Exception
- { m_oBatchH.commitBatch(p_oBP.toDTO());
- } //__________________________________
-} //____________________________________________________________________________
+ public long newBatch() throws Exception {
+ return m_oBatchH.newBatch();
+ }
+
+ public int addToBatch(String p_s) throws Exception {
+ return m_oBatchH.addToBatch(p_s);
+ }
+
+ public void finish() throws Exception {
+ m_oBatchH.finish();
+ }
+
+ public void commitBatch(BatchProcess p_oBP) throws Exception {
+ m_oBatchH.commitBatch(p_oBP.toDTO());
+ }
+}
Modified: labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/BatchHandlerFactory.java
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/BatchHandlerFactory.java 2006-08-03 21:30:57 UTC (rev 5454)
+++ labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/BatchHandlerFactory.java 2006-08-04 00:03:47 UTC (rev 5455)
@@ -19,7 +19,6 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-
package org.jboss.soa.esb.services;
import java.util.*;
@@ -29,25 +28,32 @@
public class BatchHandlerFactory
{
- private static final String [] s_saTypes = {"local","remote"};
- private final static int LCL=0;
- private final static int REM=1;
+ private static final String [] s_saTypes = {"local","remote","mock"};
+ private final static int LCL=0;
+ private final static int REM=1;
+ private final static int MOK=2;
+
+ public static IbatchHandler getBatchHandler(String p_sLocRem,
+ String p_sJndiType, String p_sJndiServer) throws Exception
+ {
+ int iIndex = Arrays.binarySearch(s_saTypes, p_sLocRem.toLowerCase());
+ if (iIndex < 0)
+ return null;
+ switch (iIndex) {
+ case REM:
+ return getBatchHandler(AppServerContext.getServerContext(
+ p_sJndiType, p_sJndiServer));
+ case LCL:
+ return new BatchHandlerBsDelegateLocal(new InitialContext());
+ case MOK:
+ return null; //return new MockBatchHandler()
+ }
+ throw new Exception("Invalid Batch Handler Delegate <" + p_sLocRem + ">");
+ }
- public static IbatchHandler getBatchHandler
- (String p_sLocRem, String p_sJndiType, String p_sJndiServer) throws Exception
- {
- int iIndex = Arrays.binarySearch(s_saTypes,p_sLocRem.toLowerCase());
- if (iIndex < 0) return null;
- switch (iIndex)
- {
- case REM: return getBatchHandler
- (AppServerContext.getServerContext(p_sJndiType,p_sJndiServer));
- case LCL: return new BatchHandlerBsDelegateLocal(new InitialContext());
- }
- throw new Exception("Invalid Batch Handler Delegate <" + p_sLocRem + ">");
- } //__________________________________
-
- public static IbatchHandler getBatchHandler(Context p_oCtx) throws Exception
- { return new BatchHandlerBsDelegateRemote(p_oCtx);
- } //__________________________________
-} //____________________________________________________________________________
+ public static IbatchHandler getBatchHandler(Context p_oCtx)
+ throws Exception
+ {
+ return new BatchHandlerBsDelegateRemote(p_oCtx);
+ }
+}
Modified: labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/EJB/BatchHandler.java
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/EJB/BatchHandler.java 2006-08-03 21:30:57 UTC (rev 5454)
+++ labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/EJB/BatchHandler.java 2006-08-04 00:03:47 UTC (rev 5455)
@@ -21,6 +21,7 @@
*/
package org.jboss.soa.esb.services.EJB;
+import org.jboss.soa.esb.common.bizclasses.BatchProcess;
import org.jboss.soa.esb.util.BobjStdDTO;
/**
@@ -30,4 +31,7 @@
{
public void finish() throws Exception;
public void commitBatch(BobjStdDTO p_oDto ) throws Exception;
+ public long newBatch() throws Exception;
+ public int addToBatch(String p_s) throws Exception;
+ public void remove();
}
Modified: labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/EJB/BatchHandlerBean.java
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/EJB/BatchHandlerBean.java 2006-08-03 21:30:57 UTC (rev 5454)
+++ labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/EJB/BatchHandlerBean.java 2006-08-04 00:03:47 UTC (rev 5455)
@@ -98,9 +98,10 @@
} //__________________________________
@Remove
- public void ejbRemove()
- { releaseResources();
- m_oLogger.info("EJB Removed");
+ public void remove()
+ {
+ releaseResources();
+ m_oLogger.info("EJB Removed");
} //__________________________________
private void getResources() throws Exception
@@ -280,24 +281,27 @@
//______________________________________________________________________________
// Public local interface methods
-/**
- */
- public void commitBatch(BatchProcess p_oBO) throws Exception
- { try { doCommitBatch(p_oBO); m_oDataConn.commit(); }
- catch (Exception e)
- { if (null != m_oDataConn) m_oDataConn.rollback();
- m_oLogger.error("commitBatch(BatchProcess) FAILED ",e);
- throw e;
- }
- finally { releaseResources(); }
- } //__________________________________
+///** KS: I'm commenting this out since we are now using the
+// same interface for local and remote calls. If all
+// works this code can be deleted.
+// */
+// public void commitBatch(BatchProcess p_oBO) throws Exception
+// { try { doCommitBatch(p_oBO); m_oDataConn.commit(); }
+// catch (Exception e)
+// { if (null != m_oDataConn) m_oDataConn.rollback();
+// m_oLogger.error("commitBatch(BatchProcess) FAILED ",e);
+// throw e;
+// }
+// finally { releaseResources(); }
+// } //__________________________________
//______________________________________________________________________________
// Public remote interface methods
/**
*/
public void commitBatch(BobjStdDTO p_oDto) throws Exception
- { commitBatch (new BatchProcess(p_oDto));
- } //__________________________________
+ {
+ commitBatch (new BatchProcess(p_oDto).toDTO());
+ }
} //____________________________________________________________________________
Modified: labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/NotifHandlerBsDelegateLocal.java
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/NotifHandlerBsDelegateLocal.java 2006-08-03 21:30:57 UTC (rev 5454)
+++ labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/NotifHandlerBsDelegateLocal.java 2006-08-04 00:03:47 UTC (rev 5455)
@@ -30,19 +30,21 @@
public class NotifHandlerBsDelegateLocal implements InotificationHandler
{
- //KS private NotificationHandlerLocal m_oNotifH;
- public NotifHandlerBsDelegateLocal(Context p_ctx) throws Exception
- {
- Object ref = p_ctx.lookup("NotificationHandlerLocal");
+ private NotificationHandler m_oNotifH;
+
+ public NotifHandlerBsDelegateLocal(Context p_ctx) throws Exception
+ {
+ m_oNotifH = (NotificationHandler) p_ctx.lookup("NotificationHandlerBean/local");
+ }
- //KS NotificationHandlerLocalHome oHu = (NotificationHandlerLocalHome) ref;
- //KS m_oNotifH = oHu.create();
- } //__________________________________
+ public void sendNotifications(DomElement p_oP, Serializable p_o)
+ throws Exception
+ {
+ m_oNotifH.sendNotifications(p_oP.toString(), p_o);
+ }
- public void sendNotifications(DomElement p_oP, Serializable p_o) throws Exception
- { //KS m_oNotifH.sendNotifications(p_oP.toString(),p_o);
- }
- public void sendNotifications(Serializable p_o) throws Exception
- { //KS m_oNotifH.sendNotifications(null,p_o);
- }
-} //____________________________________________________________________________
+ public void sendNotifications(Serializable p_o) throws Exception
+ {
+ m_oNotifH.sendNotifications(null, p_o);
+ }
+}
Modified: labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/NotifHandlerBsDelegateRemote.java
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/NotifHandlerBsDelegateRemote.java 2006-08-03 21:30:57 UTC (rev 5454)
+++ labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/NotifHandlerBsDelegateRemote.java 2006-08-04 00:03:47 UTC (rev 5455)
@@ -24,27 +24,27 @@
package org.jboss.soa.esb.services;
import javax.naming.*;
-import javax.rmi.*;
import java.io.Serializable;
import org.jboss.soa.esb.helpers.*;
import org.jboss.soa.esb.services.EJB.*;
public class NotifHandlerBsDelegateRemote implements InotificationHandler
{
- private NotificationHandler m_oNotifH;
+ private NotificationHandler m_oNotifH;
- public NotifHandlerBsDelegateRemote(Context p_ctx) throws Exception
- {
- Object ref = p_ctx.lookup("NotificationHandler");
- //KS Object oNarr = PortableRemoteObject.narrow(ref, NotificationHandlerHome.class);
- //KS NotificationHandlerHome oHu = (NotificationHandlerHome) oNarr;
- //KS m_oNotifH = oHu.create();
- } //__________________________________
+ public NotifHandlerBsDelegateRemote(Context p_ctx) throws Exception
+ {
+ m_oNotifH = (NotificationHandler) p_ctx.lookup("NotificationHandlerBean/remote");
+ }
- public void sendNotifications(DomElement p_oP, Serializable p_o) throws Exception
- { m_oNotifH.sendNotifications(p_oP.toString(),p_o);
- } //__________________________________
- public void sendNotifications(Serializable p_o) throws Exception
- { m_oNotifH.sendNotifications(null,p_o);
- }
-} //____________________________________________________________________________
+ public void sendNotifications(DomElement p_oP, Serializable p_o)
+ throws Exception
+ {
+ m_oNotifH.sendNotifications(p_oP.toString(), p_o);
+ }
+
+ public void sendNotifications(Serializable p_o) throws Exception
+ {
+ m_oNotifH.sendNotifications(null, p_o);
+ }
+}
Modified: labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/NotificationHandlerFactory.java
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/NotificationHandlerFactory.java 2006-08-03 21:30:57 UTC (rev 5454)
+++ labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/NotificationHandlerFactory.java 2006-08-04 00:03:47 UTC (rev 5455)
@@ -31,9 +31,10 @@
public class NotificationHandlerFactory
{
- private static final String [] s_saTypes = {"local","remote"};
+ private static final String [] s_saTypes = {"local","remote","mock"};
private final static int LCL=0;
private final static int REM=1;
+ private final static int MOK=2;
public static InotificationHandler getNotifHandler
(String p_sLocRem, String p_sJndiType, String p_sJndiServer) throws Exception
@@ -45,12 +46,14 @@
case REM: return getNotifHandler
(AppServerContext.getServerContext(p_sJndiType,p_sJndiServer));
case LCL: return new NotifHandlerBsDelegateLocal(new InitialContext());
+
+ case MOK: return null; //return new MockNotificationHandler();
}
throw new Exception("Invalid Notification Handler Delegate <" + p_sLocRem + ">");
- } //__________________________________
+ }
- public static InotificationHandler getNotifHandler(Context p_oCtx) throws Exception
- { return new NotifHandlerBsDelegateRemote(p_oCtx);
- } //__________________________________
-
-} //____________________________________________________________________________
+ private static InotificationHandler getNotifHandler(Context p_oCtx) throws Exception
+ {
+ return new NotifHandlerBsDelegateRemote(p_oCtx);
+ }
+}
Modified: labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/PersistHandlerBsDelegateLocal.java
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/PersistHandlerBsDelegateLocal.java 2006-08-03 21:30:57 UTC (rev 5454)
+++ labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/PersistHandlerBsDelegateLocal.java 2006-08-04 00:03:47 UTC (rev 5455)
@@ -32,47 +32,45 @@
public class PersistHandlerBsDelegateLocal implements IpersistHandler
{
- //private PersistHandlerLocal m_oSnapH;
+ private PersistHandler m_oSnapH;
- public PersistHandlerBsDelegateLocal(Context p_ctx) throws Exception
- {
- Object ref = p_ctx.lookup("PersistHandlerLocal");
+ public PersistHandlerBsDelegateLocal(Context p_ctx) throws Exception {
+ m_oSnapH = (PersistHandler) p_ctx.lookup("PersistHandlerBean/local");
+ }
-// PersistHandlerLocalHome oHu = (PersistHandlerLocalHome) ref;
-// m_oSnapH = oHu.create();
- } //__________________________________
+ public long getUidChunk(int p_iQ) throws Exception {
+ return m_oSnapH.getUidChunk(p_iQ);
+ }
- public void remove() throws Exception {
- //KS m_oSnapH.remove();
- }
- public long getUidChunk(int p_iQ) throws Exception
- { return 0; //KS m_oSnapH.getUidChunk(p_iQ);
- } //__________________________________
- public long addObject (BobjStdDTO p_oDto) throws Exception
- { return 0; //KS m_oSnapH.addDTO(p_oDto);
- } //__________________________________
- public long addObject (BaseBusinessObject p_oBo) throws Exception
- { p_oBo.setPackage();
- return 0; //KS m_oSnapH.addDTO(p_oBo.toDTO());
- } //__________________________________
- public BaseBusinessObject getObject (Class p_oCls, long p_lUid) throws Exception
- { //KS BobjStdDTO oDto = m_oSnapH.getDTO(p_oCls.getName(), p_lUid);
- return null; //KS (null==oDto)?null:BaseBusinessObject.getFromDTO(oDto);
- } //__________________________________
- public void rmvObject (Class p_oCls, long p_lUid) throws Exception
- { //KS m_oSnapH.rmvObject(p_oCls.getName(), p_lUid);
- } //__________________________________
- public void rplObject (BaseBusinessObject p_o) throws Exception
- { p_o.setPackage();
- //KS m_oSnapH.rplDTO(p_o.toDTO());
- } //__________________________________
- public ObjLocator[] getLocatorList(Class p_oCls, Properties p_oProp)
- {
- return null;
- } //__________________________________
+ public long addObject(BobjStdDTO p_oDto) throws Exception {
+ return m_oSnapH.addDTO(p_oDto);
+ }
- public ObjLocator[] getLocatorList(Class p_oCls, long[] p_laUids)
- {
- return null;
- } //__________________________________
+ public long addObject(BaseBusinessObject p_oBo) throws Exception {
+ p_oBo.setPackage();
+ return m_oSnapH.addDTO(p_oBo.toDTO());
+ }
+
+ public BaseBusinessObject getObject(Class p_oCls, long p_lUid)
+ throws Exception {
+ BobjStdDTO oDto = m_oSnapH.getDTO(p_oCls.getName(), p_lUid);
+ return (null == oDto) ? null : BaseBusinessObject.getFromDTO(oDto);
+ }
+
+ public void rmvObject(Class p_oCls, long p_lUid) throws Exception {
+ m_oSnapH.rmvObject(p_oCls.getName(), p_lUid);
+ }
+
+ public void rplObject(BaseBusinessObject p_o) throws Exception {
+ p_o.setPackage();
+ m_oSnapH.rplDTO(p_o.toDTO());
+ }
+
+ public ObjLocator[] getLocatorList(Class p_oCls, Properties p_oProp) {
+ return null;
+ } //__________________________________
+
+ public ObjLocator[] getLocatorList(Class p_oCls, long[] p_laUids) {
+ return null;
+ } //__________________________________
} //____________________________________________________________________________
Modified: labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/PersistHandlerBsDelegateRemote.java
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/PersistHandlerBsDelegateRemote.java 2006-08-03 21:30:57 UTC (rev 5454)
+++ labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/PersistHandlerBsDelegateRemote.java 2006-08-04 00:03:47 UTC (rev 5455)
@@ -24,7 +24,6 @@
package org.jboss.soa.esb.services;
import javax.naming.*;
-import javax.rmi.*;
import org.jboss.soa.esb.services.EJB.*;
import org.jboss.soa.esb.util.*;
@@ -33,42 +32,45 @@
public class PersistHandlerBsDelegateRemote implements IpersistHandler
{
- private PersistHandler m_oSnapH;
+ private PersistHandler m_oSnapH;
public PersistHandlerBsDelegateRemote(Context p_ctx) throws Exception
{
- Object ref = p_ctx.lookup("PersistHandler");
- //KS Object oNarr = PortableRemoteObject.narrow(ref, PersistHandlerHome.class);
- //KS PersistHandlerHome oHu = (PersistHandlerHome) oNarr;
- //KS m_oSnapH = oHu.create();
- } //__________________________________
+ m_oSnapH = (PersistHandler) p_ctx.lookup("PersistHandlerBean/remote");
+ }
- public void remove() throws Exception {}
public long getUidChunk(int p_iQ) throws Exception
- { return m_oSnapH.getUidChunk(p_iQ);
- } //__________________________________
- public long addObject (BaseBusinessObject p_oBo) throws Exception
- { if (null==p_oBo) return -1;
+ {
+ return m_oSnapH.getUidChunk(p_iQ);
+ }
+
+ public long addObject (BaseBusinessObject p_oBo) throws Exception
+ {
+ if (null==p_oBo) return -1;
p_oBo.setPackage();
BobjStdDTO oDto = p_oBo.toDTO();
oDto.setLocators(p_oBo.allLocators());
return m_oSnapH.addDTO(oDto);
- } //__________________________________
+ }
+
public BaseBusinessObject getObject (Class p_oCls, long p_lUid) throws Exception
{
BobjStdDTO oDto = m_oSnapH.getDTO(p_oCls.getName(), p_lUid);
return (null==oDto)?null:BaseBusinessObject.getFromDTO(oDto);
- } //__________________________________
- public void rmvObject (Class p_oCls, long p_lUid) throws Exception
- { m_oSnapH.rmvObject(p_oCls.getName(), p_lUid);
- } //__________________________________
- public void rplObject (BaseBusinessObject p_oBo) throws Exception
+ }
+
+ public void rmvObject (Class p_oCls, long p_lUid) throws Exception
+ {
+ m_oSnapH.rmvObject(p_oCls.getName(), p_lUid);
+ }
+
+ public void rplObject (BaseBusinessObject p_oBo) throws Exception
{ if (null==p_oBo) return;
p_oBo.setPackage();
BobjStdDTO oDto = p_oBo.toDTO();
oDto.setLocators(p_oBo.allLocators());
m_oSnapH.rplDTO(oDto);
- } //__________________________________
+ }
public ObjLocator[] getLocatorList(Class p_oCls, Properties p_oProp)
{
Modified: labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/PersistHandlerFactory.java
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/PersistHandlerFactory.java 2006-08-03 21:30:57 UTC (rev 5454)
+++ labs/jbossesb/branches/ejb3/product/core/services/src/org/jboss/soa/esb/services/PersistHandlerFactory.java 2006-08-04 00:03:47 UTC (rev 5455)
@@ -30,9 +30,10 @@
public class PersistHandlerFactory
{
- private static final String [] s_saTypes = {"local","remote"};
+ private static final String [] s_saTypes = {"local","remote","mock"};
private final static int LCL=0;
private final static int REM=1;
+ private final static int MOK=2;
public static IpersistHandler getPersistHandler
(String p_sLocRem, String p_sJndiType, String p_sJndiServer) throws Exception
@@ -44,12 +45,14 @@
case REM: return getPersistHandler
(AppServerContext.getServerContext(p_sJndiType,p_sJndiServer));
case LCL: return new PersistHandlerBsDelegateLocal(new InitialContext());
+
+ case MOK: return null; //new MockPersistHandler();
}
throw new Exception("Invalid Persist Handler Delegate <" + p_sLocRem + ">");
- } //__________________________________
+ }
public static IpersistHandler getPersistHandler(Context p_oCtx) throws Exception
- { return new PersistHandlerBsDelegateRemote(p_oCtx);
- } //__________________________________
-
-} //____________________________________________________________________________
+ {
+ return new PersistHandlerBsDelegateRemote(p_oCtx);
+ }
+}
Copied: labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test (from rev 5417, labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/tests/notification)
Deleted: labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/NotificationFuncTest.java
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/tests/notification/NotificationFuncTest.java 2006-08-02 20:29:46 UTC (rev 5417)
+++ labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/NotificationFuncTest.java 2006-08-04 00:03:47 UTC (rev 5455)
@@ -1,217 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.soa.esb.services.tests.notification;
-
-import java.util.*;
-import java.text.SimpleDateFormat;
-
-import org.jboss.soa.esb.common.SystemProperties;
-import org.jboss.soa.esb.common.tests.BaseTest;
-import org.jboss.soa.esb.helpers.*;
-import org.jboss.soa.esb.helpers.persist.SimpleDataSource;
-import org.jboss.soa.esb.notification.*;
-import org.jboss.soa.esb.services.InotificationHandler;
-import org.jboss.soa.esb.services.Zap;
-
-// DON'T FORGET !!
-// The Rosetta Application server has to be up and running
-// (set JNDI_SERVER appropriately)
-// For e-mail notification: System properties for smtp
-// (server, user, password, port) must be set up in app server
-
-public class NotificationFuncTest extends BaseTest
-{
- private static InotificationHandler m_oH;
-
-
- public NotificationFuncTest() {
- }
-
- public void testNotImplementedFuncTest() {
- log.info("*******************************************");
- log.info("Requires Implementation");
- log.info("*******************************************");
- new Zap();
- }
-
- /*
- public NotificationFuncTest () throws Exception
- { performTest(); }
-
- static void performTest() throws Exception
- {
- // get a handle to your business delegate
- m_oH = NotificationHandlerFactory.getNotifHandler
- ("remote"
- ,SystemProperties.getJndiServerType()
- ,SystemProperties.getJndiServerURL()
- );
-
- DomElement oEl = new DomElement("MyFileList");
- oEl.setAttr(NotificationList.TYPE,"OK");
-
- // oEl.addElemChild(fileListTarget());
- // oEl.addElemChild(emailTarget());
- // oEl.addElemChild(jmsQueueTarget());
- // oEl.addElemChild(jmsTopicTarget());
- oEl.addElemChild(sqlTableTarget());
-
- NotificationList oNL = new NotificationList(oEl);
-
- // to see how the XML looks like
- // this is just a unit test class
- // Typically the XML is used in a parameter object (DomElement.fromXml())
- System.out.println(oNL.toString());
-
- // a simple timestamped message
- Date oNow = new Date(System.currentTimeMillis());
- SimpleDateFormat oStamp = new SimpleDateFormat("dd/MMM/yyyy HH:mm:ss.SSS");
- StringBuilder sb = new StringBuilder(oStamp.format(oNow))
- .append(" This message from Notification test");
-
- m_oH.sendNotifications(oNL,sb.toString());
- } //________________________________
-
- static DomElement emailTarget() throws Exception
- {
- DomElement oTgt = new DomElement(NotificationList.CHILD_TGT);
- oTgt.setAttr(NotificationTarget.PRM_NOTIF_CLASS,"NotifyEmail");
- oTgt.setAttr(EsbEmail.FROM,"sender at jboss.com");
- oTgt.setAttr(EsbEmail.SENDTO,"receiver1 at hotmail.com,receiver2 at jboss.com");;
- oTgt.setAttr(EsbEmail.SUBJECT,"TEST from Rosetta");
- oTgt.setAttr(EsbEmail.MESSAGE,"This is the text of your message");
-
- // This class does NOT send the e-mails, the app server does
- // consequently these paths would have to be accessible in the
- // application server (filesystem / mounts)
- String[] sa = {"/tmp/tomcat.sh","/tmp/program.js"};
- for (String sCurr : sa)
- oTgt.addTextChild(EsbEmail.ATTACH,sCurr);
-
- return oTgt;
- } //________________________________
-
- static DomElement fileListTarget() throws Exception
- {
- DomElement oTgt = new DomElement(NotificationList.CHILD_TGT);
- oTgt.setAttr(NotificationTarget.PRM_NOTIF_CLASS,"NotifyFiles");
-
- // This class does NOT write the files, the app server does
- // consequently these paths would have to be accessible in the
- // application server (filesystem / mounts)
- String[] sa = {"file:///tmp/file1.notif","file:///tmp/file2.notif"};
- for (String sCurr : sa)
- { DomElement oFile = new DomElement(NotifyFiles.CHILD_FILE);
- oFile.setAttr(NotifyFiles.ATT_URI,sCurr);
- oFile.setAttr(NotifyFiles.ATT_APPEND,Boolean.toString(true));
- oTgt.addElemChild(oFile);
- }
- return oTgt;
- } //________________________________
-
- static DomElement jmsQueueTarget() throws Exception
- {
- DomElement oTgt = new DomElement(NotificationList.CHILD_TGT);
- oTgt.setAttr(NotificationTarget.PRM_NOTIF_CLASS,"NotifyQueues");
-
- String[] sa = {"queue/A","queue/B"};
- for (String sCurr : sa)
- { DomElement oQ = new DomElement(NotifyQueues.CHILD_QUEUE);
- oQ.setAttr(NotifyJMS.ATT_DEST_NAME,sCurr);
- for (DomElement oProp : getMessageProperties())
- oQ.addElemChild(oProp);
- oTgt.addElemChild(oQ);
- }
- return oTgt;
- } //________________________________
-
- static DomElement jmsTopicTarget() throws Exception
- {
- DomElement oTgt = new DomElement(NotificationList.CHILD_TGT);
- oTgt.setAttr(NotificationTarget.PRM_NOTIF_CLASS,"NotifyTopics");
-
- String[] sa = {"topic/testTopic"};
- for (String sCurr : sa)
- { DomElement oQ = new DomElement(NotifyTopics.CHILD_TOPIC);
- oQ.setAttr(NotifyJMS.ATT_DEST_NAME,sCurr);
- for (DomElement oProp : getMessageProperties())
- oQ.addElemChild(oProp);
- oTgt.addElemChild(oQ);
- }
- return oTgt;
- } //________________________________
-
- static DomElement[] getMessageProperties() throws Exception
- {
- KeyValuePair[] oaProps = new KeyValuePair[]
- {new KeyValuePair("prop1","111")
- ,new KeyValuePair("prop2","bbb")
- ,new KeyValuePair("prop3","abc123")
- };
- DomElement[] oaRet = new DomElement[oaProps.length];
- int iCurr = 0;
- for (KeyValuePair oCurr : oaProps)
- { DomElement oElem = new DomElement(NotifyJMS.CHILD_MSG_PROP);
- oElem.setAttr(NotifyJMS.ATT_PROP_NAME,oCurr.getKey());
- oElem.setAttr(NotifyJMS.ATT_PROP_VALUE,oCurr.getValue());
- oaRet[iCurr++] = oElem;
- }
- return oaRet;
- } //________________________________
-
- static DomElement sqlTableTarget() throws Exception
- {
- DomElement oTgt = new DomElement(NotificationList.CHILD_TGT);
- oTgt.setAttr(NotificationTarget.PRM_NOTIF_CLASS,"NotifySqlTable");
-
- oTgt.setAttr(SimpleDataSource.DRIVER,"org.postgresql.Driver");
- oTgt.setAttr(SimpleDataSource.URL,"jdbc:postgresql://lavasca:5432/rosetta");
- oTgt.setAttr(SimpleDataSource.USER,"postgres");
- oTgt.setAttr(SimpleDataSource.PASSWORD,"");
-
- // Table name for insert - must exist in database (URL)
- oTgt.setAttr(NotifySqlTable.ATT_TABLE,"test_notif_table");
- // Column that will contain the dynamic data generated by the ActionClass
- // must exist in table (ATT_TABLE above)
- oTgt.setAttr(NotifySqlTable.ATT_DATA,"msg");
-
- // constant data that can be also added in the insert
- // (perhaps needed for queries)
- // Key = column name (it must exist in the table, same as ATT_DATA column)
- KeyValuePair[] oaCols = new KeyValuePair[]
- {new KeyValuePair("src","TestNotification")
- ,new KeyValuePair("ref","any Ref")
- ,new KeyValuePair("val1","VVVV 11111")
- };
- for (KeyValuePair oCurr : oaCols)
- { DomElement oElem = new DomElement(NotifySqlTable.CHILD_COLUMN);
- oElem.setAttr(NotifySqlTable.ATT_NAME,oCurr.getKey());
- oElem.setAttr(NotifySqlTable.ATT_VALUE,oCurr.getValue());
- oTgt.addElemChild(oElem);
- }
-
-
- return oTgt;
- } //________________________________
-
- */
-} //____________________________________________________________________________
Copied: labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/NotificationFuncTest.java (from rev 5454, labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/tests/notification/NotificationFuncTest.java)
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/tests/notification/NotificationFuncTest.java 2006-08-03 21:30:57 UTC (rev 5454)
+++ labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/NotificationFuncTest.java 2006-08-04 00:03:47 UTC (rev 5455)
@@ -0,0 +1,221 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.services.EJB.test;
+
+import java.util.*;
+import java.text.SimpleDateFormat;
+
+import org.jboss.soa.esb.common.SystemProperties;
+import org.jboss.soa.esb.common.tests.BaseTest;
+import org.jboss.soa.esb.common.tests.EJBContainerSetup;
+import org.jboss.soa.esb.helpers.*;
+import org.jboss.soa.esb.helpers.persist.SimpleDataSource;
+import org.jboss.soa.esb.notification.*;
+import org.jboss.soa.esb.services.InotificationHandler;
+import org.jboss.soa.esb.services.Zap;
+
+// DON'T FORGET !!
+// The Rosetta Application server has to be up and running
+// (set JNDI_SERVER appropriately)
+// For e-mail notification: System properties for smtp
+// (server, user, password, port) must be set up in app server
+
+public class NotificationFuncTest extends BaseTest
+{
+ private static InotificationHandler m_oH;
+
+ public void setUp(){
+ EJBContainerSetup.startupEmbeddedJboss();
+ }
+
+ public NotificationFuncTest() {
+ }
+
+ public void testNotImplementedFuncTest() {
+ log.info("*******************************************");
+ log.info("Requires Implementation");
+ log.info("*******************************************");
+ new Zap();
+ }
+
+ /*
+ public NotificationFuncTest () throws Exception
+ { performTest(); }
+
+ static void performTest() throws Exception
+ {
+ // get a handle to your business delegate
+ m_oH = NotificationHandlerFactory.getNotifHandler
+ ("remote"
+ ,SystemProperties.getJndiServerType()
+ ,SystemProperties.getJndiServerURL()
+ );
+
+ DomElement oEl = new DomElement("MyFileList");
+ oEl.setAttr(NotificationList.TYPE,"OK");
+
+ // oEl.addElemChild(fileListTarget());
+ // oEl.addElemChild(emailTarget());
+ // oEl.addElemChild(jmsQueueTarget());
+ // oEl.addElemChild(jmsTopicTarget());
+ oEl.addElemChild(sqlTableTarget());
+
+ NotificationList oNL = new NotificationList(oEl);
+
+ // to see how the XML looks like
+ // this is just a unit test class
+ // Typically the XML is used in a parameter object (DomElement.fromXml())
+ System.out.println(oNL.toString());
+
+ // a simple timestamped message
+ Date oNow = new Date(System.currentTimeMillis());
+ SimpleDateFormat oStamp = new SimpleDateFormat("dd/MMM/yyyy HH:mm:ss.SSS");
+ StringBuilder sb = new StringBuilder(oStamp.format(oNow))
+ .append(" This message from Notification test");
+
+ m_oH.sendNotifications(oNL,sb.toString());
+ } //________________________________
+
+ static DomElement emailTarget() throws Exception
+ {
+ DomElement oTgt = new DomElement(NotificationList.CHILD_TGT);
+ oTgt.setAttr(NotificationTarget.PRM_NOTIF_CLASS,"NotifyEmail");
+ oTgt.setAttr(EsbEmail.FROM,"sender at jboss.com");
+ oTgt.setAttr(EsbEmail.SENDTO,"receiver1 at hotmail.com,receiver2 at jboss.com");;
+ oTgt.setAttr(EsbEmail.SUBJECT,"TEST from Rosetta");
+ oTgt.setAttr(EsbEmail.MESSAGE,"This is the text of your message");
+
+ // This class does NOT send the e-mails, the app server does
+ // consequently these paths would have to be accessible in the
+ // application server (filesystem / mounts)
+ String[] sa = {"/tmp/tomcat.sh","/tmp/program.js"};
+ for (String sCurr : sa)
+ oTgt.addTextChild(EsbEmail.ATTACH,sCurr);
+
+ return oTgt;
+ } //________________________________
+
+ static DomElement fileListTarget() throws Exception
+ {
+ DomElement oTgt = new DomElement(NotificationList.CHILD_TGT);
+ oTgt.setAttr(NotificationTarget.PRM_NOTIF_CLASS,"NotifyFiles");
+
+ // This class does NOT write the files, the app server does
+ // consequently these paths would have to be accessible in the
+ // application server (filesystem / mounts)
+ String[] sa = {"file:///tmp/file1.notif","file:///tmp/file2.notif"};
+ for (String sCurr : sa)
+ { DomElement oFile = new DomElement(NotifyFiles.CHILD_FILE);
+ oFile.setAttr(NotifyFiles.ATT_URI,sCurr);
+ oFile.setAttr(NotifyFiles.ATT_APPEND,Boolean.toString(true));
+ oTgt.addElemChild(oFile);
+ }
+ return oTgt;
+ } //________________________________
+
+ static DomElement jmsQueueTarget() throws Exception
+ {
+ DomElement oTgt = new DomElement(NotificationList.CHILD_TGT);
+ oTgt.setAttr(NotificationTarget.PRM_NOTIF_CLASS,"NotifyQueues");
+
+ String[] sa = {"queue/A","queue/B"};
+ for (String sCurr : sa)
+ { DomElement oQ = new DomElement(NotifyQueues.CHILD_QUEUE);
+ oQ.setAttr(NotifyJMS.ATT_DEST_NAME,sCurr);
+ for (DomElement oProp : getMessageProperties())
+ oQ.addElemChild(oProp);
+ oTgt.addElemChild(oQ);
+ }
+ return oTgt;
+ } //________________________________
+
+ static DomElement jmsTopicTarget() throws Exception
+ {
+ DomElement oTgt = new DomElement(NotificationList.CHILD_TGT);
+ oTgt.setAttr(NotificationTarget.PRM_NOTIF_CLASS,"NotifyTopics");
+
+ String[] sa = {"topic/testTopic"};
+ for (String sCurr : sa)
+ { DomElement oQ = new DomElement(NotifyTopics.CHILD_TOPIC);
+ oQ.setAttr(NotifyJMS.ATT_DEST_NAME,sCurr);
+ for (DomElement oProp : getMessageProperties())
+ oQ.addElemChild(oProp);
+ oTgt.addElemChild(oQ);
+ }
+ return oTgt;
+ } //________________________________
+
+ static DomElement[] getMessageProperties() throws Exception
+ {
+ KeyValuePair[] oaProps = new KeyValuePair[]
+ {new KeyValuePair("prop1","111")
+ ,new KeyValuePair("prop2","bbb")
+ ,new KeyValuePair("prop3","abc123")
+ };
+ DomElement[] oaRet = new DomElement[oaProps.length];
+ int iCurr = 0;
+ for (KeyValuePair oCurr : oaProps)
+ { DomElement oElem = new DomElement(NotifyJMS.CHILD_MSG_PROP);
+ oElem.setAttr(NotifyJMS.ATT_PROP_NAME,oCurr.getKey());
+ oElem.setAttr(NotifyJMS.ATT_PROP_VALUE,oCurr.getValue());
+ oaRet[iCurr++] = oElem;
+ }
+ return oaRet;
+ } //________________________________
+
+ static DomElement sqlTableTarget() throws Exception
+ {
+ DomElement oTgt = new DomElement(NotificationList.CHILD_TGT);
+ oTgt.setAttr(NotificationTarget.PRM_NOTIF_CLASS,"NotifySqlTable");
+
+ oTgt.setAttr(SimpleDataSource.DRIVER,"org.postgresql.Driver");
+ oTgt.setAttr(SimpleDataSource.URL,"jdbc:postgresql://lavasca:5432/rosetta");
+ oTgt.setAttr(SimpleDataSource.USER,"postgres");
+ oTgt.setAttr(SimpleDataSource.PASSWORD,"");
+
+ // Table name for insert - must exist in database (URL)
+ oTgt.setAttr(NotifySqlTable.ATT_TABLE,"test_notif_table");
+ // Column that will contain the dynamic data generated by the ActionClass
+ // must exist in table (ATT_TABLE above)
+ oTgt.setAttr(NotifySqlTable.ATT_DATA,"msg");
+
+ // constant data that can be also added in the insert
+ // (perhaps needed for queries)
+ // Key = column name (it must exist in the table, same as ATT_DATA column)
+ KeyValuePair[] oaCols = new KeyValuePair[]
+ {new KeyValuePair("src","TestNotification")
+ ,new KeyValuePair("ref","any Ref")
+ ,new KeyValuePair("val1","VVVV 11111")
+ };
+ for (KeyValuePair oCurr : oaCols)
+ { DomElement oElem = new DomElement(NotifySqlTable.CHILD_COLUMN);
+ oElem.setAttr(NotifySqlTable.ATT_NAME,oCurr.getKey());
+ oElem.setAttr(NotifySqlTable.ATT_VALUE,oCurr.getValue());
+ oTgt.addElemChild(oElem);
+ }
+
+
+ return oTgt;
+ } //________________________________
+
+ */
+} //____________________________________________________________________________
Added: labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/NotificationTest.java
===================================================================
--- labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/tests/notification/NotificationTest.java 2006-08-02 20:29:46 UTC (rev 5417)
+++ labs/jbossesb/branches/ejb3/product/core/services/tests/src/org/jboss/soa/esb/services/EJB/test/NotificationTest.java 2006-08-04 00:03:47 UTC (rev 5455)
@@ -0,0 +1,235 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.services.EJB.test;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Hashtable;
+
+import javax.naming.InitialContext;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.Priority;
+import org.jboss.soa.esb.common.tests.BaseTest;
+import org.jboss.soa.esb.common.tests.EJBContainerSetup;
+import org.jboss.soa.esb.helpers.DomElement;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.soa.esb.helpers.persist.SimpleDataSource;
+import org.jboss.soa.esb.notification.NotificationList;
+import org.jboss.soa.esb.notification.NotificationTarget;
+import org.jboss.soa.esb.notification.NotifySqlTable;
+import org.jboss.soa.esb.services.InotificationHandler;
+import org.jboss.soa.esb.services.EJB.NotificationHandler;
+
+
+public class NotificationTest extends BaseTest
+{
+ private Logger logger = Logger.getLogger(NotificationTest.class);
+
+ public void testNotification() {
+ try {
+ logger.log(Priority.INFO, "Notification Test");
+ InitialContext ctx = getInitialContext();
+ NotificationHandler local = (NotificationHandler ) ctx.lookup("NotificationHandlerBean/local");
+
+
+
+ DomElement oEl = new DomElement("MyFileList");
+ oEl.setAttr(NotificationList.TYPE,"OK");
+
+ // oEl.addElemChild(fileListTarget());
+ // oEl.addElemChild(emailTarget());
+ // oEl.addElemChild(jmsQueueTarget());
+ // oEl.addElemChild(jmsTopicTarget());
+ oEl.addElemChild(sqlTableTarget());
+
+ NotificationList oNL = new NotificationList(oEl);
+
+ // to see how the XML looks like
+ // this is just a unit test class
+ // Typically the XML is used in a parameter object (DomElement.fromXml())
+ System.out.println(oNL.toString());
+
+ // a simple timestamped message
+ Date oNow = new Date(System.currentTimeMillis());
+ SimpleDateFormat oStamp = new SimpleDateFormat("dd/MMM/yyyy HH:mm:ss.SSS");
+ StringBuilder sb = new StringBuilder(oStamp.format(oNow))
+ .append(" This message from Notification test");
+
+ local.sendNotifications(oNL.toString(),sb.toString());
+
+ } catch (Exception e) {
+ logger.log(Priority.ERROR, e.getMessage(), e);
+ }
+ }
+
+ public void testKurt() {
+ logger.log(Priority.INFO, "Test Kurt");
+
+ }
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(NotificationTest.class);
+ return new EJBContainerSetup(suite);
+ }
+
+ public static InitialContext getInitialContext() throws Exception
+ {
+ Hashtable props = getInitialContextProperties();
+ return new InitialContext(props);
+ }
+
+ private static Hashtable getInitialContextProperties()
+ {
+ Hashtable props = new Hashtable();
+ props.put("java.naming.factory.initial", "org.jnp.interfaces.LocalOnlyContextFactory");
+ props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
+ return props;
+ }
+
+// static DomElement emailTarget() throws Exception
+// {
+// DomElement oTgt = new DomElement(NotificationList.CHILD_TGT);
+// oTgt.setAttr(NotificationTarget.PRM_NOTIF_CLASS,"NotifyEmail");
+// oTgt.setAttr(EsbEmail.FROM,"sender at jboss.com");
+// oTgt.setAttr(EsbEmail.SENDTO,"receiver1 at hotmail.com,receiver2 at jboss.com");;
+// oTgt.setAttr(EsbEmail.SUBJECT,"TEST from Rosetta");
+// oTgt.setAttr(EsbEmail.MESSAGE,"This is the text of your message");
+//
+// // This class does NOT send the e-mails, the app server does
+// // consequently these paths would have to be accessible in the
+// // application server (filesystem / mounts)
+// String[] sa = {"/tmp/tomcat.sh","/tmp/program.js"};
+// for (String sCurr : sa)
+// oTgt.addTextChild(EsbEmail.ATTACH,sCurr);
+//
+// return oTgt;
+// } //________________________________
+//
+// static DomElement fileListTarget() throws Exception
+// {
+// DomElement oTgt = new DomElement(NotificationList.CHILD_TGT);
+// oTgt.setAttr(NotificationTarget.PRM_NOTIF_CLASS,"NotifyFiles");
+//
+// // This class does NOT write the files, the app server does
+// // consequently these paths would have to be accessible in the
+// // application server (filesystem / mounts)
+// String[] sa = {"file:///tmp/file1.notif","file:///tmp/file2.notif"};
+// for (String sCurr : sa)
+// { DomElement oFile = new DomElement(NotifyFiles.CHILD_FILE);
+// oFile.setAttr(NotifyFiles.ATT_URI,sCurr);
+// oFile.setAttr(NotifyFiles.ATT_APPEND,Boolean.toString(true));
+// oTgt.addElemChild(oFile);
+// }
+// return oTgt;
+// } //________________________________
+//
+// static DomElement jmsQueueTarget() throws Exception
+// {
+// DomElement oTgt = new DomElement(NotificationList.CHILD_TGT);
+// oTgt.setAttr(NotificationTarget.PRM_NOTIF_CLASS,"NotifyQueues");
+//
+// String[] sa = {"queue/A","queue/B"};
+// for (String sCurr : sa)
+// { DomElement oQ = new DomElement(NotifyQueues.CHILD_QUEUE);
+// oQ.setAttr(NotifyJMS.ATT_DEST_NAME,sCurr);
+// for (DomElement oProp : getMessageProperties())
+// oQ.addElemChild(oProp);
+// oTgt.addElemChild(oQ);
+// }
+// return oTgt;
+// } //________________________________
+//
+// static DomElement jmsTopicTarget() throws Exception
+// {
+// DomElement oTgt = new DomElement(NotificationList.CHILD_TGT);
+// oTgt.setAttr(NotificationTarget.PRM_NOTIF_CLASS,"NotifyTopics");
+//
+// String[] sa = {"topic/testTopic"};
+// for (String sCurr : sa)
+// { DomElement oQ = new DomElement(NotifyTopics.CHILD_TOPIC);
+// oQ.setAttr(NotifyJMS.ATT_DEST_NAME,sCurr);
+// for (DomElement oProp : getMessageProperties())
+// oQ.addElemChild(oProp);
+// oTgt.addElemChild(oQ);
+// }
+// return oTgt;
+// } //________________________________
+//
+// static DomElement[] getMessageProperties() throws Exception
+// {
+// KeyValuePair[] oaProps = new KeyValuePair[]
+// {new KeyValuePair("prop1","111")
+// ,new KeyValuePair("prop2","bbb")
+// ,new KeyValuePair("prop3","abc123")
+// };
+// DomElement[] oaRet = new DomElement[oaProps.length];
+// int iCurr = 0;
+// for (KeyValuePair oCurr : oaProps)
+// { DomElement oElem = new DomElement(NotifyJMS.CHILD_MSG_PROP);
+// oElem.setAttr(NotifyJMS.ATT_PROP_NAME,oCurr.getKey());
+// oElem.setAttr(NotifyJMS.ATT_PROP_VALUE,oCurr.getValue());
+// oaRet[iCurr++] = oElem;
+// }
+// return oaRet;
+// } //________________________________
+
+ static DomElement sqlTableTarget() throws Exception
+ {
+ DomElement oTgt = new DomElement(NotificationList.CHILD_TGT);
+ oTgt.setAttr(NotificationTarget.PRM_NOTIF_CLASS,"NotifySqlTable");
+
+ oTgt.setAttr(SimpleDataSource.DRIVER,"org.postgresql.Driver");
+ oTgt.setAttr(SimpleDataSource.URL,"jdbc:postgresql://lavasca:5432/rosetta");
+ oTgt.setAttr(SimpleDataSource.USER,"postgres");
+ oTgt.setAttr(SimpleDataSource.PASSWORD,"");
+
+ // Table name for insert - must exist in database (URL)
+ oTgt.setAttr(NotifySqlTable.ATT_TABLE,"test_notif_table");
+ // Column that will contain the dynamic data generated by the ActionClass
+ // must exist in table (ATT_TABLE above)
+ oTgt.setAttr(NotifySqlTable.ATT_DATA,"msg");
+
+ // constant data that can be also added in the insert
+ // (perhaps needed for queries)
+ // Key = column name (it must exist in the table, same as ATT_DATA column)
+ KeyValuePair[] oaCols = new KeyValuePair[]
+ {new KeyValuePair("src","TestNotification")
+ ,new KeyValuePair("ref","any Ref")
+ ,new KeyValuePair("val1","VVVV 11111")
+ };
+ for (KeyValuePair oCurr : oaCols)
+ { DomElement oElem = new DomElement(NotifySqlTable.CHILD_COLUMN);
+ oElem.setAttr(NotifySqlTable.ATT_NAME,oCurr.getKey());
+ oElem.setAttr(NotifySqlTable.ATT_VALUE,oCurr.getValue());
+ oTgt.addElemChild(oElem);
+ }
+
+ return oTgt;
+ }
+
+}
+
+
Added: labs/jbossesb/branches/ejb3/product/lib/ext/hibernate-all.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/branches/ejb3/product/lib/ext/hibernate-all.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/branches/ejb3/product/lib/ext/jboss-ejb3-all.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/branches/ejb3/product/lib/ext/jboss-ejb3-all.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbossesb/branches/ejb3/product/lib/ext/thirdparty-all.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbossesb/branches/ejb3/product/lib/ext/thirdparty-all.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
More information about the jboss-svn-commits
mailing list