This repository has been archived by the owner on Aug 11, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into NEXUS-5662-userid-mdc
Conflicts: plugins/siesta/nexus-siesta-plugin/src/main/java/org/sonatype/nexus/plugins/siesta/SiestaModule.java
- Loading branch information
Showing
49 changed files
with
1,368 additions
and
353 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
57 changes: 57 additions & 0 deletions
57
nexus-core/src/main/java/org/sonatype/nexus/guice/AbstractInterceptorModule.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,57 @@ | ||
/* | ||
* Sonatype Nexus (TM) Open Source Version | ||
* Copyright (c) 2007-2012 Sonatype, Inc. | ||
* All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions. | ||
* | ||
* This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0, | ||
* which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html. | ||
* | ||
* Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks | ||
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the | ||
* Eclipse Foundation. All other trademarks are the property of their respective owners. | ||
*/ | ||
|
||
package org.sonatype.nexus.guice; | ||
|
||
import java.lang.reflect.Method; | ||
|
||
import org.aopalliance.intercept.MethodInterceptor; | ||
|
||
import com.google.inject.AbstractModule; | ||
import com.google.inject.Key; | ||
import com.google.inject.matcher.Matcher; | ||
import com.google.inject.name.Names; | ||
|
||
/** | ||
* Workaround to automatically share method interceptors until | ||
* <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=403108">proper Sisu feature</a> is implemented. | ||
* | ||
* <p> | ||
* This module is only bound once in its originating realm, when the bindInterceptor method is first called. The Nexus | ||
* Plugin Manager can then see this module via the injected dynamic list of AbstractInterceptorModules and will install | ||
* it in any plugins registered after this point. | ||
* | ||
* <p> | ||
* Note: you can't contribute interceptors to earlier plugins or from a plugin to core, but the other direction works fine. | ||
* | ||
* @since 2.4 | ||
*/ | ||
public abstract class AbstractInterceptorModule | ||
extends AbstractModule | ||
{ | ||
private boolean bound; | ||
|
||
@Override | ||
protected void bindInterceptor( final Matcher<? super Class<?>> classMatcher, | ||
final Matcher<? super Method> methodMatcher, | ||
final MethodInterceptor... interceptors ) | ||
{ | ||
if ( !bound ) | ||
{ | ||
// Explicitly bind module instance under a specific sub-type (not Module as Guice forbids that) | ||
bind( Key.get( AbstractInterceptorModule.class, Names.named( getClass().getName() ) ) ).toInstance( this ); | ||
bound = true; | ||
} | ||
super.bindInterceptor( classMatcher, methodMatcher, interceptors ); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
nexus-core/src/main/java/org/sonatype/nexus/guice/FilterChainModule.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,37 @@ | ||
/* | ||
* Sonatype Nexus (TM) Open Source Version | ||
* Copyright (c) 2007-2012 Sonatype, Inc. | ||
* All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions. | ||
* | ||
* This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0, | ||
* which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html. | ||
* | ||
* Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks | ||
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the | ||
* Eclipse Foundation. All other trademarks are the property of their respective owners. | ||
*/ | ||
|
||
package org.sonatype.nexus.guice; | ||
|
||
import org.sonatype.nexus.security.FilterChain; | ||
import com.google.inject.AbstractModule; | ||
import com.google.inject.name.Names; | ||
|
||
/** | ||
* Support module for configuring {@link FilterChain}s. | ||
* | ||
* @since 2.5 | ||
*/ | ||
public abstract class FilterChainModule | ||
extends AbstractModule | ||
{ | ||
|
||
protected void addFilterChain( final String pathPattern, final String filterExpression ) | ||
{ | ||
bind( FilterChain.class ) | ||
.annotatedWith( Names.named( pathPattern ) ) | ||
.toInstance( new FilterChain( pathPattern, filterExpression ) | ||
); | ||
} | ||
|
||
} |
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
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
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
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.