Java Code Examples for io.undertow.server.handlers.resource.ResourceManager#isResourceChangeListenerSupported()

The following examples show how to use io.undertow.server.handlers.resource.ResourceManager#isResourceChangeListenerSupported() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ManagedServlet.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void start() throws ServletException {
    try {
        handle = factory.createInstance();
    } catch (Exception e) {
        throw UndertowServletMessages.MESSAGES.couldNotInstantiateComponent(servletInfo.getName(), e);
    }
    instance = handle.getInstance();
    new LifecyleInterceptorInvocation(servletContext.getDeployment().getDeploymentInfo().getLifecycleInterceptors(), servletInfo, instance, new ServletConfigImpl(servletInfo, servletContext)).proceed();

    //if a servlet implements FileChangeCallback it will be notified of file change events
    final ResourceManager resourceManager = servletContext.getDeployment().getDeploymentInfo().getResourceManager();
    if(instance instanceof ResourceChangeListener && resourceManager.isResourceChangeListenerSupported()) {
        resourceManager.registerResourceChangeListener(changeListener = (ResourceChangeListener) instance);
    }
}
 
Example 2
Source File: PrefixingResourceManager.java    From HotswapAgent with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void registerResourceChangeListener(ResourceChangeListener listener) {
    for(ResourceManager del : delegates) {
        if(del.isResourceChangeListenerSupported()) {
            del.registerResourceChangeListener(listener);
        }
    }
}
 
Example 3
Source File: PrefixingResourceManager.java    From HotswapAgent with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void removeResourceChangeListener(ResourceChangeListener listener) {
    for(ResourceManager del : delegates) {
        if(del.isResourceChangeListenerSupported()) {
            del.removeResourceChangeListener(listener);
        }
    }
}