You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Jarek Gawor (JIRA)" <ji...@apache.org> on 2006/12/22 05:27:21 UTC

[jira] Created: (CXF-323) Improper synchronization of getDefaultBus(), setDefaultBus()

Improper synchronization of getDefaultBus(), setDefaultBus()
------------------------------------------------------------

                 Key: CXF-323
                 URL: http://issues.apache.org/jira/browse/CXF-323
             Project: CXF
          Issue Type: Bug
            Reporter: Jarek Gawor


getDefaultBus() method in org.apache.cxf.bus.spring.SpringBusFactory and org.apache.cxf.bus.cxf.CXFBusFactory is improperly synchronized. The method is instance-level synchronized while it initializes and accesses a class-level variable. Two different instances of BusFactory each calling getDefaultBus() at the same time could return two different Bus instances...

This method should either be changed to 'public static synchronized Bus getDefaultBus()' or modified as for an example:

public Bus getDefaultBus() {
  return initDefaultBus();
}

private static synchronized Bus initDefaultBus() {
  if (null == defaultBus) {
         defaultBus = new CXFBusImpl();
  }
  return defaultBus;
}

Also, the setDefaultBus() method in both classes needs to be properly synchronized. 


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Assigned: (CXF-323) Improper synchronization of getDefaultBus(), setDefaultBus()

Posted by "Bozhong Lin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bozhong Lin reassigned CXF-323:
-------------------------------

    Assignee: willem Jiang

> Improper synchronization of getDefaultBus(), setDefaultBus()
> ------------------------------------------------------------
>
>                 Key: CXF-323
>                 URL: https://issues.apache.org/jira/browse/CXF-323
>             Project: CXF
>          Issue Type: Bug
>            Reporter: Jarek Gawor
>         Assigned To: willem Jiang
>
> getDefaultBus() method in org.apache.cxf.bus.spring.SpringBusFactory and org.apache.cxf.bus.cxf.CXFBusFactory is improperly synchronized. The method is instance-level synchronized while it initializes and accesses a class-level variable. Two different instances of BusFactory each calling getDefaultBus() at the same time could return two different Bus instances...
> This method should either be changed to 'public static synchronized Bus getDefaultBus()' or modified as for an example:
> public Bus getDefaultBus() {
>   return initDefaultBus();
> }
> private static synchronized Bus initDefaultBus() {
>   if (null == defaultBus) {
>          defaultBus = new CXFBusImpl();
>   }
>   return defaultBus;
> }
> Also, the setDefaultBus() method in both classes needs to be properly synchronized. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (CXF-323) Improper synchronization of getDefaultBus(), setDefaultBus()

Posted by "Bozhong Lin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bozhong Lin updated CXF-323:
----------------------------

    Assignee:     (was: willem Jiang)

> Improper synchronization of getDefaultBus(), setDefaultBus()
> ------------------------------------------------------------
>
>                 Key: CXF-323
>                 URL: https://issues.apache.org/jira/browse/CXF-323
>             Project: CXF
>          Issue Type: Bug
>            Reporter: Jarek Gawor
>
> getDefaultBus() method in org.apache.cxf.bus.spring.SpringBusFactory and org.apache.cxf.bus.cxf.CXFBusFactory is improperly synchronized. The method is instance-level synchronized while it initializes and accesses a class-level variable. Two different instances of BusFactory each calling getDefaultBus() at the same time could return two different Bus instances...
> This method should either be changed to 'public static synchronized Bus getDefaultBus()' or modified as for an example:
> public Bus getDefaultBus() {
>   return initDefaultBus();
> }
> private static synchronized Bus initDefaultBus() {
>   if (null == defaultBus) {
>          defaultBus = new CXFBusImpl();
>   }
>   return defaultBus;
> }
> Also, the setDefaultBus() method in both classes needs to be properly synchronized. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-323) Improper synchronization of getDefaultBus(), setDefaultBus()

Posted by "willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12465458 ] 

willem Jiang commented on CXF-323:
----------------------------------

It could be easy to get the initDefaultBus() to be static synchronized in CXFBusFactory. 
But in SpringBusFactory, there is ApplicationContext which hold the spring configuration is not static, and I am not going to change it to be a static variable, because we may need to setup different Context in the same JVM.

Basicly we add the getDefaultBus() in BusFactory interface is we need to make a bridge between JAXWS API which has no bus to be used and CXF-RT which uses bus for holding the pluggable extension.  
I think we have too much BusFactory implementations currently. The CXFBusFactory is useless now, we need to remove it. 

It can make the world more quite now.

Any thoughts?


> Improper synchronization of getDefaultBus(), setDefaultBus()
> ------------------------------------------------------------
>
>                 Key: CXF-323
>                 URL: https://issues.apache.org/jira/browse/CXF-323
>             Project: CXF
>          Issue Type: Bug
>            Reporter: Jarek Gawor
>         Assigned To: willem Jiang
>
> getDefaultBus() method in org.apache.cxf.bus.spring.SpringBusFactory and org.apache.cxf.bus.cxf.CXFBusFactory is improperly synchronized. The method is instance-level synchronized while it initializes and accesses a class-level variable. Two different instances of BusFactory each calling getDefaultBus() at the same time could return two different Bus instances...
> This method should either be changed to 'public static synchronized Bus getDefaultBus()' or modified as for an example:
> public Bus getDefaultBus() {
>   return initDefaultBus();
> }
> private static synchronized Bus initDefaultBus() {
>   if (null == defaultBus) {
>          defaultBus = new CXFBusImpl();
>   }
>   return defaultBus;
> }
> Also, the setDefaultBus() method in both classes needs to be properly synchronized. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (CXF-323) Improper synchronization of getDefaultBus(), setDefaultBus()

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-323.
-----------------------------

       Resolution: Fixed
    Fix Version/s: 2.0-RC

> Improper synchronization of getDefaultBus(), setDefaultBus()
> ------------------------------------------------------------
>
>                 Key: CXF-323
>                 URL: https://issues.apache.org/jira/browse/CXF-323
>             Project: CXF
>          Issue Type: Bug
>            Reporter: Jarek Gawor
>         Assigned To: Daniel Kulp
>             Fix For: 2.0-RC
>
>
> getDefaultBus() method in org.apache.cxf.bus.spring.SpringBusFactory and org.apache.cxf.bus.cxf.CXFBusFactory is improperly synchronized. The method is instance-level synchronized while it initializes and accesses a class-level variable. Two different instances of BusFactory each calling getDefaultBus() at the same time could return two different Bus instances...
> This method should either be changed to 'public static synchronized Bus getDefaultBus()' or modified as for an example:
> public Bus getDefaultBus() {
>   return initDefaultBus();
> }
> private static synchronized Bus initDefaultBus() {
>   if (null == defaultBus) {
>          defaultBus = new CXFBusImpl();
>   }
>   return defaultBus;
> }
> Also, the setDefaultBus() method in both classes needs to be properly synchronized. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-323) Improper synchronization of getDefaultBus(), setDefaultBus()

Posted by "Adi Sakala (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adi Sakala updated CXF-323:
---------------------------

    Assignee: Daniel Kulp

> Improper synchronization of getDefaultBus(), setDefaultBus()
> ------------------------------------------------------------
>
>                 Key: CXF-323
>                 URL: https://issues.apache.org/jira/browse/CXF-323
>             Project: CXF
>          Issue Type: Bug
>            Reporter: Jarek Gawor
>         Assigned To: Daniel Kulp
>
> getDefaultBus() method in org.apache.cxf.bus.spring.SpringBusFactory and org.apache.cxf.bus.cxf.CXFBusFactory is improperly synchronized. The method is instance-level synchronized while it initializes and accesses a class-level variable. Two different instances of BusFactory each calling getDefaultBus() at the same time could return two different Bus instances...
> This method should either be changed to 'public static synchronized Bus getDefaultBus()' or modified as for an example:
> public Bus getDefaultBus() {
>   return initDefaultBus();
> }
> private static synchronized Bus initDefaultBus() {
>   if (null == defaultBus) {
>          defaultBus = new CXFBusImpl();
>   }
>   return defaultBus;
> }
> Also, the setDefaultBus() method in both classes needs to be properly synchronized. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.