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

Daniel Kulp resolved CXF-6091.
------------------------------
       Resolution: Fixed
    Fix Version/s: 2.7.14
                   3.0.3
         Assignee: Daniel Kulp

Patch applied.  Thanks!

> Server is not properly stopped with MultipleEndpointObserver
> ------------------------------------------------------------
>
>                 Key: CXF-6091
>                 URL: https://issues.apache.org/jira/browse/CXF-6091
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.5, 3.0.1
>            Reporter: Vadim Beilin
>            Assignee: Daniel Kulp
>             Fix For: 3.0.3, 2.7.14
>
>         Attachments: stopstart-1.patch
>
>
> org.apache.cxf.endpoint.ServerImpl#stop() contains this code to handle 
> MultipleEndpointObserver:
> {code}
>         ...
>         if (slcMgr != null) {
>             slcMgr.stopServer(this);
>         }
>         MessageObserver mo = getDestination().getMessageObserver();
>         if (mo instanceof MultipleEndpointObserver) {
>             ((MultipleEndpointObserver)mo).getEndpoints().remove(endpoint);
>             if (!((MultipleEndpointObserver)mo).getEndpoints().isEmpty()) {
>                 return;
>             }
>         }
>         getDestination().setMessageObserver(null);
>         stopped = true;
>     }
> {code}
> The intention seems to be to not remove the message observer until there are 
> endpoints attached, but a side effect is that in such a case the server 
> instance is _not_ marked as stopped, and therefore cannot be restarted.
> One way to solve it would be to change the code above to
> {code}
>         if (slcMgr != null) {
>             slcMgr.stopServer(this);
>         }
>         MessageObserver mo = getDestination().getMessageObserver();
>         if (mo instanceof MultipleEndpointObserver) {
>             ((MultipleEndpointObserver)mo).getEndpoints().remove(endpoint);
>             if (((MultipleEndpointObserver)mo).getEndpoints().isEmpty()) {
>                 getDestination().setMessageObserver(null);
>             }
>         } else {
>             getDestination().setMessageObserver(null);
>         }
>         stopped = true;
>     }
> {code}
> making sure that stopped is set on all (non-throwing) codepaths.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to