Package org.restlet.engine.component
Class ComponentHelper
- java.lang.Object
-
- org.restlet.engine.Helper
-
- org.restlet.engine.RestletHelper<T>
-
- org.restlet.engine.CompositeHelper<Component>
-
- org.restlet.engine.component.ComponentHelper
-
public class ComponentHelper extends CompositeHelper<Component>
Component helper.
-
-
Field Summary
Fields Modifier and Type Field Description private ClientRouterclientRouterThe internal client router.private ServerRouterserverRouterThe internal server router.
-
Constructor Summary
Constructors Constructor Description ComponentHelper(Component component)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleancheckVirtualHost(VirtualHost host)Check the applications attached to a virtual host.ClientRoutergetClientRouter()Returns the internal client router.ServerRoutergetServerRouter()Returns the internal host router.voidsetServerRouter(ServerRouter serverRouter)Sets the internal server router.voidstart()Start callback.voidstop()Stop callback.private voidstopHostApplications(VirtualHost host)Stop all applications attached to a virtual hostvoidupdate()Set the new server router that will compute the new routes when the first request will be received (automatic start).-
Methods inherited from class org.restlet.engine.CompositeHelper
addInboundFilter, addOutboundFilter, clear, getFirstInboundFilter, getFirstOutboundFilter, getInboundNext, getLastInboundFilter, getLastOutboundFilter, getOutboundNext, handle, setFirstInboundFilter, setFirstOutboundFilter, setInboundNext, setLastInboundFilter, setLastOutboundFilter, setOutboundNext
-
Methods inherited from class org.restlet.engine.RestletHelper
getAttributes, getContext, getHelped, getHelpedParameters, getLogger, getMetadataService, setHelped
-
-
-
-
Field Detail
-
clientRouter
private final ClientRouter clientRouter
The internal client router.
-
serverRouter
private volatile ServerRouter serverRouter
The internal server router.
-
-
Constructor Detail
-
ComponentHelper
public ComponentHelper(Component component)
Constructor.- Parameters:
component- The helper component.
-
-
Method Detail
-
checkVirtualHost
private boolean checkVirtualHost(VirtualHost host) throws java.lang.Exception
Check the applications attached to a virtual host.- Parameters:
host- The parent virtual host.- Returns:
- True if the check succeeded.
- Throws:
java.lang.Exception
-
getClientRouter
public ClientRouter getClientRouter()
Returns the internal client router.- Returns:
- the internal client router.
-
getServerRouter
public ServerRouter getServerRouter()
Returns the internal host router.- Returns:
- the internal host router.
-
setServerRouter
public void setServerRouter(ServerRouter serverRouter)
Sets the internal server router.- Parameters:
serverRouter- The internal host router.
-
start
public void start() throws java.lang.ExceptionDescription copied from class:RestletHelperStart callback.- Specified by:
startin classRestletHelper<Component>- Throws:
java.lang.Exception
-
stop
public void stop() throws java.lang.ExceptionDescription copied from class:RestletHelperStop callback.- Specified by:
stopin classRestletHelper<Component>- Throws:
java.lang.Exception
-
stopHostApplications
private void stopHostApplications(VirtualHost host) throws java.lang.Exception
Stop all applications attached to a virtual host- Parameters:
host-- Throws:
java.lang.Exception
-
update
public void update() throws java.lang.ExceptionSet the new server router that will compute the new routes when the first request will be received (automatic start).- Specified by:
updatein classRestletHelper<Component>- Throws:
java.lang.Exception
-
-