[seam-commits] Seam SVN: r10585 - branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Wed Apr 22 10:39:19 EDT 2009
Author: manaRH
Date: 2009-04-22 10:39:18 -0400 (Wed, 22 Apr 2009)
New Revision: 10585
Modified:
branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/BusinessProcessContext.java
branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/Lifecycle.java
branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/TestLifecycle.java
Log:
JBPAPP-1925
Modified: branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/BusinessProcessContext.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/BusinessProcessContext.java 2009-04-22 14:30:27 UTC (rev 10584)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/BusinessProcessContext.java 2009-04-22 14:39:18 UTC (rev 10585)
@@ -35,13 +35,25 @@
private final Map<String, Object> additions = new HashMap<String, Object>();
private final Set<String> removals = new HashSet<String>();
+ private final boolean enabled;
public ScopeType getType()
{
return ScopeType.BUSINESS_PROCESS;
}
- public BusinessProcessContext() {}
+ public BusinessProcessContext()
+ {
+ Init init = Init.instance();
+ if (init == null)
+ {
+ enabled = false;
+ }
+ else
+ {
+ enabled = init.isJbpmInstalled();
+ }
+ }
public Object get(String name)
{
@@ -208,8 +220,7 @@
private org.jbpm.graph.exe.ProcessInstance getProcessInstance()
{
- Init init = Init.instance(); //may be null in some tests
- if ( init==null || !init.isJbpmInstalled() )
+ if (!enabled)
{
return null;
}
@@ -221,8 +232,7 @@
private org.jbpm.taskmgmt.exe.TaskInstance getTaskInstance()
{
- Init init = Init.instance(); //may be null in some tests
- if ( init==null || !init.isJbpmInstalled() )
+ if (!enabled)
{
return null;
}
Modified: branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/Lifecycle.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/Lifecycle.java 2009-04-22 14:30:27 UTC (rev 10584)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/Lifecycle.java 2009-04-22 14:39:18 UTC (rev 10585)
@@ -81,11 +81,11 @@
public static void beginCall()
{
log.debug( ">>> Begin call" );
+ Contexts.applicationContext.set( new ApplicationContext(getApplication()) );
Contexts.eventContext.set( new BasicContext(ScopeType.EVENT) );
Contexts.sessionContext.set( new BasicContext(ScopeType.SESSION) );
Contexts.conversationContext.set( new BasicContext(ScopeType.CONVERSATION) );
Contexts.businessProcessContext.set( new BusinessProcessContext() );
- Contexts.applicationContext.set( new ApplicationContext(getApplication()) );
}
public static void endCall()
Modified: branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/TestLifecycle.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/TestLifecycle.java 2009-04-22 14:30:27 UTC (rev 10584)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/TestLifecycle.java 2009-04-22 14:39:18 UTC (rev 10585)
@@ -29,11 +29,11 @@
public static void beginTest(ServletContext context, Map<String, Object> session)
{
log.debug( ">>> Begin test" );
+ Contexts.applicationContext.set( new ApplicationContext( new ServletApplicationMap(context) ) );
Contexts.eventContext.set( new BasicContext(ScopeType.EVENT) );
Contexts.conversationContext.set( new BasicContext(ScopeType.CONVERSATION) );
Contexts.businessProcessContext.set( new BusinessProcessContext() );
Contexts.sessionContext.set( new SessionContext(session) );
- Contexts.applicationContext.set( new ApplicationContext( new ServletApplicationMap(context) ) );
}
public static void endTest()
More information about the seam-commits
mailing list