Package interlok.management.proxy
Class ProxyMgmtComponent
- java.lang.Object
-
- com.adaptris.core.management.MgmtComponentImpl
-
- interlok.management.proxy.ProxyMgmtComponent
-
- All Implemented Interfaces:
ManagementComponent
public class ProxyMgmtComponent extends MgmtComponentImpl
Management Component that allows you to proxy various HTTP requests internally.The use case for this is something like Heroku which generally only allows you to expose a single external port. If you have an existing API endpoint listening via embedded jetty and you have also require jolokia then you need to jump through additional hoops to make this possible (it could be done by having an additional API endpoint workflow that proxies everything to the jolokia endpoint). This is a very simplified proxy simply passes through all headers as-is to the proxied URL.
If we take the following configuration (note the use of :: as the separator) :-
In this case we would register as a listener against the URI /jolokia/* and /alternate/* against the embedded jetty component. All traffic to our registered URI (e.g. http://localhost:8080/jolokia/my/jolokia/action) would be forwarded to the corresponding server/port combination (http://localhost:8081/jolokia/my/jolokia/action).interlok.proxy.1=/jolokia::http://localhost:8081 interlok.proxy.2=/alternate::http://my.other.host:8082
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.management.MgmtComponentImpl
log
-
-
Constructor Summary
Constructors Constructor Description ProxyMgmtComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<StandaloneConsumer>build(java.util.Properties config)voiddestroy()voidinit(java.util.Properties config)voidstart()voidstop()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.management.ManagementComponent
setClassLoader
-
-
-
-
Method Detail
-
init
public void init(java.util.Properties config) throws java.lang.Exception- Throws:
java.lang.Exception
-
start
public void start() throws java.lang.Exception- Throws:
java.lang.Exception
-
stop
public void stop() throws java.lang.Exception- Throws:
java.lang.Exception
-
destroy
public void destroy() throws java.lang.Exception- Throws:
java.lang.Exception
-
build
protected java.util.List<StandaloneConsumer> build(java.util.Properties config)
-
-