axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cory Wilkerson" <cwilker...@travelnow.com>
Subject MessageContext
Date Mon, 27 Jan 2003 17:38:33 GMT
Is the following thread safe?  The fact that this is a static method scares me a bit, ie, will
MessageContext.getCurrentContext() hold true in situations like this or is it possible that
as two threads enter this method simultaneously...things could get a little funky.


 public static RequestHandler getInstance() {
        RequestHandler handler = null;

        MessageContext mc = MessageContext.getCurrentContext();
        if (mc != null && mc.getService() != null) {
            String serviceName = mc.getService().getName();
            if (serviceName != null) {
                if (serviceName.equalsIgnoreCase("SomeServiceName")) {
                    handler = new TNowAirHandler();
                }
            }
        }

        return handler;
    }



Mime
View raw message