Martin Gainty created AXIS2-5660:
------------------------------------

             Summary: AXIS 2 Doc correction
                 Key: AXIS2-5660
                 URL: https://issues.apache.org/jira/browse/AXIS2-5660
             Project: Axis2
          Issue Type: Bug
          Components: documentation
    Affects Versions: 1.6.2
            Reporter: Martin Gainty


Handlers and Chains can be defined to have 'per-access', 'per-request', or 
'singleton' scope although the registry currently only distinguishes between 
these by constructing non-singleton scope objects when requested and 
constructing singleton scope objects once and holding on to them for use on 
subsequent creation requests.

There are NO singleton implementations of Handlers ..here is proof:
public class FactoryRegistry {

    private static volatile Map<Class, Object> table;
    private static Object lockbox = new Object();
    private static final Log log = LogFactory.getLog(FactoryRegistry.class);
    
    static {
        try {
            init();
        } catch (Throwable t){
            log.error(t.getMessage(), t);
        }
    }
    
    private static final void init() {
        
        // An unsynchronized Map is used to ensure that gets are fast.
        table = new HashMap<Class, Object>(64, .5f);
     ,,,,
 table.put(HandlerInvokerFactory.class, new HandlerInvokerFactoryImpl());
}
//later on when you access HandlerInvokerFactory you get the 
//SAME HandlerInvokerFactoryImpl that you instantated:
 /**
     * Get the factory.  This may be called frequently.
     * @param intface of the Factory
     * @return Object that is the factory implementation for the intface
     */
    public static Object getFactory(Class intface) {
        Map m = table;
        return m.get(intface);
    }
//so the RegistryFactory exhibits Singleton like behaviour
//but what happens when I create a HandlerInvokeFactory?

package org.apache.axis2.jaxws.handler.factory.impl;
/**
 * This is the default implementation of the HandlerInvokerFactory, 
 * and it will be registered with the FactoryRegistry.
 */
public class HandlerInvokerFactoryImpl implements HandlerInvokerFactory {
public HandlerInvoker createHandlerInvoker(MessageContext messageContext) {
        return new HandlerInvokerImpl();
    }
}
If this is NOT singleton which clearly it is not then you need to 
correct this documentation asap
http://axis.apache.org/axis/java/architecture-guide.html

16 July 2014
Martin Gainty






--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscr...@axis.apache.org
For additional commands, e-mail: java-dev-h...@axis.apache.org

Reply via email to