Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding API for @InterceptorBinding-bound interceptor registration in …
…EjbServices. git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@3862 1c488680-804c-0410-94cd-c6b725194a0e
- Loading branch information
1 parent
ba5cb0f
commit 968009a
Showing
5 changed files
with
139 additions
and
30 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
81 changes: 81 additions & 0 deletions
81
spi/src/main/java/org/jboss/webbeans/ejb/spi/InterceptorBindings.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,81 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual | ||
* contributors by the @authors tag. See the copyright.txt in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.jboss.webbeans.ejb.spi; | ||
|
||
import java.util.List; | ||
import java.util.Collection; | ||
import java.lang.reflect.Method; | ||
|
||
import javax.enterprise.inject.spi.Interceptor; | ||
import javax.enterprise.inject.spi.InterceptionType; | ||
import javax.interceptor.InterceptorBinding; | ||
|
||
/** | ||
* @author Marius Bogoevici | ||
*/ | ||
public interface InterceptorBindings | ||
{ | ||
/** | ||
* Returns all interceptors that are bound to an EJB object through | ||
* the {@link InterceptorBinding} mechanism and are | ||
* enabled through the beans.xml file. | ||
* | ||
* This includes class and method-bound interceptors.The purpose of this | ||
* method is to indicate what interceptors does the container need to | ||
* interact with, for a given EJB. | ||
* | ||
* Note: in the case of an EJB, the expectation is that the interpretation | ||
* of {link @javax.interceptor.Interceptors} is left to the container, and | ||
* the interceptors provided by the binding are complementary | ||
*/ | ||
Collection<Interceptor<?>> getAllInterceptors(); | ||
|
||
|
||
/** | ||
* Returns the interceptors that are applicable to a given {@link InterceptionType} | ||
* and method (bound by {@link InterceptorBinding}). | ||
* This includes class and method-bound interceptors, but no interceptors | ||
* bound by EJB-specific mechanisms. | ||
* | ||
* @param interceptionType - the interception type (non-lifecycle) | ||
* @param method - the method that is to be intercepted | ||
* @return - an immutable list of interceptors applicable to the method (empty if no such | ||
* interceptors exist) | ||
* @throw IllegalArgumentException if interceptionType is not {@link InterceptionType.AROUND_INVOKE} | ||
* or {@link InterceptionType.AROUND_TIMEOUT} | ||
*/ | ||
List<Interceptor<?>> getMethodInterceptors(InterceptionType interceptionType, Method method); | ||
|
||
|
||
/** | ||
* Returns the lifecycle interceptors that are applicable to a given {@link InterceptionType} | ||
* (bound by {@link InterceptorBinding}). | ||
* | ||
* This includes class and method-bound interceptors, but no interceptors | ||
* bound by EJB-specific mechanisms. | ||
* | ||
* @param interceptionType - the interception type (lifecycle) | ||
* @param method - the method that is to be intercepted | ||
* @return - an immutable list of interceptors applicable to the method (empty if no such | ||
* interceptors exist) | ||
* @throw IllegalArgumentException if interceptionType not {@link InterceptionType.AROUND_INVOKE} | ||
* or {@link InterceptionType.AROUND_TIMEOUT} | ||
*/ | ||
List<Interceptor<?>> getLifecycleInterceptors(InterceptionType interceptionType); | ||
|
||
} |
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
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