forked from wildfly/wildfly
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AS7-4430 InterceptorContext.getTarget() returns null for PrePassivate…
… and PostActivate methods
- Loading branch information
1 parent
57aab58
commit 97e9c62
Showing
4 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...t/java/org/jboss/as/test/integration/ejb/stateful/passivation/PassivationInterceptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package org.jboss.as.test.integration.ejb.stateful.passivation; | ||
|
||
import java.io.Serializable; | ||
|
||
import javax.ejb.PostActivate; | ||
import javax.ejb.PrePassivate; | ||
import javax.interceptor.InvocationContext; | ||
|
||
/** | ||
* @author Stuart Douglas | ||
*/ | ||
public class PassivationInterceptor implements Serializable { | ||
|
||
private static volatile Object postActivateTarget, prePassivateTarget; | ||
|
||
@PostActivate | ||
public void postActivate(final InvocationContext ctx) throws Exception { | ||
postActivateTarget = ctx.getTarget(); | ||
ctx.proceed(); | ||
} | ||
@PrePassivate | ||
public void prePassivate(final InvocationContext ctx) throws Exception { | ||
prePassivateTarget = ctx.getTarget(); | ||
ctx.proceed(); | ||
} | ||
|
||
public static void reset() { | ||
postActivateTarget = prePassivateTarget = null; | ||
} | ||
|
||
public static Object getPostActivateTarget() { | ||
return postActivateTarget; | ||
} | ||
|
||
public static Object getPrePassivateTarget() { | ||
return prePassivateTarget; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters