cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vadim Beilin (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CXF-6091) Server is not properly stopped with MultipleEndpointObserver
Date Fri, 07 Nov 2014 10:19:35 GMT

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

Vadim Beilin updated CXF-6091:
------------------------------
    Attachment: stopstart-1.patch

possible solution attached

> 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
>         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)

Mime
View raw message