-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
32 changed files
with
1,384 additions
and
39 deletions.
There are no files selected for viewing
103 changes: 103 additions & 0 deletions
103
core/api/src/main/java/cloud/piranha/core/api/HandlesTypesManager.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,103 @@ | ||
/* | ||
* Copyright (c) 2002-2024 Manorrock.com. All Rights Reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* 3. Neither the name of the copyright holder nor the names of its | ||
* contributors may be used to endorse or promote products derived from | ||
* this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
package cloud.piranha.core.api; | ||
|
||
import java.util.Set; | ||
|
||
/** | ||
* The manager that delivers support for the HandlesTypes annotation. | ||
* | ||
* <p> | ||
* Whenever the onStartup method of a ServletContainerInitializer is called it | ||
* gets passed a set of classes that it expressed interest in. This manager | ||
* delivers the way a web application can vend that set of classes. See the | ||
* JavaDoc of the ServletContainerInitializer for more information about the | ||
* onStartup method. | ||
* </p> | ||
* | ||
* @author Manfred Riem ([email protected]) | ||
*/ | ||
public interface HandlesTypesManager { | ||
|
||
/** | ||
* Add the annotated class. | ||
* | ||
* @param annotationClass the annotation class. | ||
* @param annotatedClass the annotated class. | ||
*/ | ||
void addAnnotatedClass(Class<?> annotationClass, Class<?> annotatedClass); | ||
|
||
/** | ||
* Add the extending class. | ||
* | ||
* @param baseClass the based class. | ||
* @param extendingClass the extending class. | ||
*/ | ||
void addExtendingClass(Class<?> baseClass, Class<?> extendingClass); | ||
|
||
/** | ||
* Add the implementing class. | ||
* | ||
* @param interfaceClass the interface. | ||
* @param implementingClass the implementing class. | ||
*/ | ||
void addImplementingClass(Class<?> interfaceClass, Class<?> implementingClass); | ||
|
||
/** | ||
* Get the annotated classes. | ||
* | ||
* @param annotationClass the annotation classes. | ||
* @return the annotated classes. | ||
*/ | ||
Set<Class<?>> getAnnotatedClasses(Class<?> annotationClass); | ||
|
||
/** | ||
* Get the extending classes. | ||
* | ||
* @param baseClass the base class. | ||
* @return the set of extending classes. | ||
*/ | ||
Set<Class<?>> getExtendingClasses(Class<?> baseClass); | ||
|
||
/** | ||
* Get the implementing classes. | ||
* | ||
* @param interfaceClass the interface class. | ||
* @return the set of implementing classes. | ||
*/ | ||
Set<Class<?>> getImplementingClasses(Class<?> interfaceClass); | ||
|
||
/** | ||
* Get the set of classes that either are annotated with the given classes, | ||
* implement any of the given classes, or extend any of the given classes. | ||
* | ||
* @param classes the set of given classes. | ||
* @return the set of classes or null if none found. | ||
*/ | ||
Set<Class<?>> getClasses(Set<Class<?>> classes); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ | |
import cloud.piranha.core.api.AsyncManager; | ||
import cloud.piranha.core.api.DispatcherManager; | ||
import cloud.piranha.core.api.ErrorPageManager; | ||
import cloud.piranha.core.api.HandlesTypesManager; | ||
import cloud.piranha.core.api.HttpSessionManager; | ||
import cloud.piranha.core.api.JspManager; | ||
import cloud.piranha.core.api.LocaleEncodingManager; | ||
|
@@ -49,27 +50,32 @@ | |
* @author Manfred Riem ([email protected]) | ||
*/ | ||
public class DefaultWebApplicationManager implements WebApplicationManager { | ||
|
||
/** | ||
* Stores the annotation manager. | ||
*/ | ||
protected AnnotationManager annotationManager; | ||
|
||
/** | ||
* Stores the async manager. | ||
*/ | ||
protected AsyncManager asyncManager = new DefaultAsyncManager(); | ||
|
||
/** | ||
* Stores the dispatcher manager. | ||
*/ | ||
protected DispatcherManager dispatcherManager = new DefaultDispatcherManager(); | ||
|
||
/** | ||
* Stores the error page manager. | ||
*/ | ||
protected ErrorPageManager errorPageManager = new DefaultErrorPageManager(); | ||
|
||
|
||
/** | ||
* Stores the HandlesTypes manager. | ||
*/ | ||
protected HandlesTypesManager handlesTypesManager; | ||
|
||
/** | ||
* Stores the HTTP session manager. | ||
*/ | ||
|
@@ -79,22 +85,22 @@ public class DefaultWebApplicationManager implements WebApplicationManager { | |
* Stores the JSP manager. | ||
*/ | ||
protected JspManager jspManager = new DefaultJspManager(); | ||
|
||
/** | ||
* Stores the locale encoding manager. | ||
*/ | ||
protected LocaleEncodingManager localeEncodingManager = new DefaultLocaleEncodingManager(); | ||
|
||
/** | ||
* Stores the multi-part manager. | ||
*/ | ||
protected MultiPartManager multiPartManager = new DefaultMultiPartManager(); | ||
|
||
/** | ||
* Stores the object instance manager. | ||
*/ | ||
protected ObjectInstanceManager objectInstanceManager = new DefaultObjectInstanceManager(); | ||
|
||
/** | ||
* Stores the resource manager. | ||
*/ | ||
|
@@ -104,7 +110,7 @@ public class DefaultWebApplicationManager implements WebApplicationManager { | |
* Stores the security manager. | ||
*/ | ||
protected SecurityManager securityManager = new DefaultSecurityManager(); | ||
|
||
/** | ||
* Stores the servlet request manager. | ||
*/ | ||
|
@@ -125,11 +131,6 @@ public AsyncManager getAsyncManager() { | |
return asyncManager; | ||
} | ||
|
||
/** | ||
* Get the dispatcher manager. | ||
* | ||
* @return the dispatcher manager. | ||
*/ | ||
@Override | ||
public DispatcherManager getDispatcherManager() { | ||
return dispatcherManager; | ||
|
@@ -140,6 +141,11 @@ public ErrorPageManager getErrorPageManager() { | |
return errorPageManager; | ||
} | ||
|
||
@Override | ||
public HandlesTypesManager getHandlesTypesManager() { | ||
return handlesTypesManager; | ||
} | ||
|
||
@Override | ||
public HttpSessionManager getHttpSessionManager() { | ||
return httpSessionManager; | ||
|
@@ -201,8 +207,8 @@ public void setErrorPageManager(ErrorPageManager errorPageManager) { | |
} | ||
|
||
@Override | ||
public void setServletRequestManager(ServletRequestManager servletRequestManager) { | ||
this.servletRequestManager = servletRequestManager; | ||
public void setHandlesTypesManager(HandlesTypesManager handlesTypesManager) { | ||
this.handlesTypesManager = handlesTypesManager; | ||
} | ||
|
||
@Override | ||
|
@@ -240,6 +246,11 @@ public void setSecurityManager(SecurityManager securityManager) { | |
this.securityManager = securityManager; | ||
} | ||
|
||
@Override | ||
public void setServletRequestManager(ServletRequestManager servletRequestManager) { | ||
this.servletRequestManager = servletRequestManager; | ||
} | ||
|
||
@Override | ||
public void setWelcomeFileManager(WelcomeFileManager welcomeFileManager) { | ||
this.welcomeFileManager = welcomeFileManager; | ||
|
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
Oops, something went wrong.