cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Kulp (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CXF-4862) JAXRS ServerLifeCycleManager
Date Thu, 28 Feb 2013 17:27:13 GMT

     [ https://issues.apache.org/jira/browse/CXF-4862?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Daniel Kulp resolved CXF-4862.
------------------------------

    Resolution: Not A Problem
      Assignee: Daniel Kulp


This is working as designed, kind of.   When the ServerLifeCycleManager implementation is
created within CXF, it grabs all the SercerLifeCycleListeners from the context automatically.
  You don't need to call the bus.getExtension(...) and register your manager yourself.   It's
all done automatically for you.    Remove those lines from the constructor.   

I may try delaying the lookup a bit which may prevent the circular loop in this case, but
what you are doing is not needed.
                
> JAXRS ServerLifeCycleManager 
> -----------------------------
>
>                 Key: CXF-4862
>                 URL: https://issues.apache.org/jira/browse/CXF-4862
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.7.2
>            Reporter: Sambit Dikshit
>            Assignee: Daniel Kulp
>              Labels: lifecyclemanagement
>
> I'm trying to use the ServerLifcycleLister to inject some default providers to the JAXRS
servers created during startup. This is to avoid configuration based jars:provider configuration
so that it will be implicit to users. While trying out ServerLifecycleLister, its giving out
of memory errors. Looks like its trying to run in an infinite loop.  
> My code looks like this as below. 
> public class SOAServerLifeCycleListener implements ServerLifeCycleListener {
> 	private static Logger log = LoggerFactory
> 			.getLogger(SOAServerLifeCycleListener.class);
> 	
> 	public SOAServerLifeCycleListener(Bus bus) {
> 		ServerLifeCycleManager slm = bus.getExtension(ServerLifeCycleManager.class);
> 	    slm.registerListener(this);
> 	}
> 	@Override
> 	public void startServer(Server server) {
> 		System.out.println("Server lifecycle started");	
> 	}
> 	@Override
> 	public void stopServer(Server server) {
> 		System.out.println("Server lifecycle started");	
> 	}
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message