-
-
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
35 changed files
with
85 additions
and
84 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
package cloud.piranha.extension.naming; | ||
package cloud.piranha.extension.herring; | ||
|
||
import cloud.piranha.core.api.WebApplication; | ||
import cloud.piranha.core.api.WebApplicationExtension; | ||
|
@@ -55,12 +55,12 @@ | |
* | ||
* @author Manfred Riem ([email protected]) | ||
*/ | ||
public class NamingExtension implements WebApplicationExtension { | ||
public class HerringExtension implements WebApplicationExtension { | ||
|
||
/** | ||
* Stores the logger. | ||
*/ | ||
private static final System.Logger LOGGER = System.getLogger(NamingExtension.class.getName()); | ||
private static final System.Logger LOGGER = System.getLogger(HerringExtension.class.getName()); | ||
|
||
/** | ||
* Configure the web application. | ||
|
@@ -69,13 +69,13 @@ public class NamingExtension implements WebApplicationExtension { | |
*/ | ||
@Override | ||
public void configure(WebApplication webApplication) { | ||
LOGGER.log(DEBUG, "Configuring NamingExtension"); | ||
LOGGER.log(DEBUG, "Configuring HerringExtension"); | ||
if (System.getProperty(INITIAL_CONTEXT_FACTORY) == null) { | ||
LOGGER.log(DEBUG, "Setting " + INITIAL_CONTEXT_FACTORY + " to " + NamingInitialContextFactory.class.getName()); | ||
System.setProperty(INITIAL_CONTEXT_FACTORY, NamingInitialContextFactory.class.getName()); | ||
LOGGER.log(DEBUG, "Setting " + INITIAL_CONTEXT_FACTORY + " to " + HerringInitialContextFactory.class.getName()); | ||
System.setProperty(INITIAL_CONTEXT_FACTORY, HerringInitialContextFactory.class.getName()); | ||
} | ||
if (!System.getProperty(INITIAL_CONTEXT_FACTORY).equals(NamingInitialContextFactory.class.getName())) { | ||
LOGGER.log(WARNING, INITIAL_CONTEXT_FACTORY + " is not set to " + NamingInitialContextFactory.class.getName()); | ||
if (!System.getProperty(INITIAL_CONTEXT_FACTORY).equals(HerringInitialContextFactory.class.getName())) { | ||
LOGGER.log(WARNING, INITIAL_CONTEXT_FACTORY + " is not set to " + HerringInitialContextFactory.class.getName()); | ||
} | ||
|
||
Context context = new DefaultInitialContext(); | ||
|
@@ -170,7 +170,7 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl | |
} | ||
}); | ||
|
||
NamingInitialContextFactory.setInitialContext(proxyContext); | ||
HerringInitialContextFactory.setInitialContext(proxyContext); | ||
webApplication.setAttribute(Context.class.getName(), proxyContext); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
package cloud.piranha.extension.naming; | ||
package cloud.piranha.extension.herring; | ||
|
||
import com.manorrock.herring.DefaultInitialContext; | ||
import java.util.Hashtable; | ||
|
@@ -38,7 +38,7 @@ | |
* | ||
* @author Manfred Riem ([email protected]) | ||
*/ | ||
public class NamingInitialContextFactory implements InitialContextFactory { | ||
public class HerringInitialContextFactory implements InitialContextFactory { | ||
|
||
/** | ||
* Stores the initial context. | ||
|
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 |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
package cloud.piranha.extension.naming; | ||
package cloud.piranha.extension.herring; | ||
|
||
import cloud.piranha.core.api.WebApplication; | ||
import com.manorrock.herring.thread.ThreadInitialContextFactory; | ||
|
@@ -41,12 +41,12 @@ | |
* | ||
* @author Manfred Riem ([email protected]) | ||
*/ | ||
public class NamingServletRequestListener implements ServletRequestListener { | ||
public class HerringServletRequestListener implements ServletRequestListener { | ||
|
||
/** | ||
* Stores the logger. | ||
*/ | ||
private static final System.Logger LOGGER = System.getLogger(NamingServletRequestListener.class.getName()); | ||
private static final System.Logger LOGGER = System.getLogger(HerringServletRequestListener.class.getName()); | ||
|
||
@Override | ||
public void requestDestroyed(ServletRequestEvent event) { | ||
|
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 |
---|---|---|
|
@@ -27,14 +27,14 @@ | |
*/ | ||
|
||
/** | ||
* This module delivers the JNDI integration extension. | ||
* This module integrates Manorrock Herring into Piranha. | ||
* | ||
* @author Manfred Riem ([email protected]) | ||
*/ | ||
module cloud.piranha.extension.naming { | ||
module cloud.piranha.extension.herring { | ||
|
||
exports cloud.piranha.extension.naming; | ||
opens cloud.piranha.extension.naming; | ||
exports cloud.piranha.extension.herring; | ||
opens cloud.piranha.extension.herring; | ||
requires cloud.piranha.core.api; | ||
requires transitive com.manorrock.herring; | ||
requires transitive com.manorrock.herring.thread; | ||
|
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 |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
package cloud.piranha.extension.naming; | ||
package cloud.piranha.extension.herring; | ||
|
||
import static javax.naming.Context.INITIAL_CONTEXT_FACTORY; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
@@ -44,11 +44,11 @@ | |
import jakarta.servlet.ServletRequestListener; | ||
|
||
/** | ||
* The JUnit tests for the NamingExtension class. | ||
* The JUnit tests for the HerringExtension class. | ||
* | ||
* @author Manfred Riem ([email protected]) | ||
*/ | ||
class NamingExtensionTest { | ||
class HerringExtensionTest { | ||
|
||
/** | ||
* Test configure method. | ||
|
@@ -57,9 +57,9 @@ class NamingExtensionTest { | |
*/ | ||
@Test | ||
void testConfigure() throws Exception { | ||
System.setProperty(INITIAL_CONTEXT_FACTORY, NamingInitialContextFactory.class.getName()); | ||
System.setProperty(INITIAL_CONTEXT_FACTORY, HerringInitialContextFactory.class.getName()); | ||
EmbeddedPiranha piranha = new EmbeddedPiranhaBuilder() | ||
.extension(NamingExtension.class) | ||
.extension(HerringExtension.class) | ||
.listener(TestServletRequestListener.class.getName()) | ||
.build() | ||
.start(); | ||
|
@@ -81,12 +81,12 @@ void testConfigure() throws Exception { | |
@Test | ||
void testConfigure2() throws Exception { | ||
new EmbeddedPiranhaBuilder() | ||
.extension(NamingExtension.class) | ||
.extension(HerringExtension.class) | ||
.listener(TestServletRequestListener.class.getName()) | ||
.build() | ||
.start(); | ||
assertEquals(System.getProperty(INITIAL_CONTEXT_FACTORY), | ||
NamingInitialContextFactory.class.getName()); | ||
HerringInitialContextFactory.class.getName()); | ||
} | ||
|
||
/** | ||
|
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.