|
Author: jacopoc
Date: Mon Jul 23 06:35:03 2012 New Revision: 1364512 URL: http://svn.apache.org/viewvc?rev=1364512&view=rev Log: Further cleanups to the DispatchContext class: * service definitions are created automatically by the setDispatcher method in order to guarantee the validity of the object status * removed get/setAttributes (and supporting field) that were an old and not used feature * made the "name" field final (small step in the direction of improving the thread safety of the class, there is still some work to do here) Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/DispatchContext.java ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/DispatchContext.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/DispatchContext.java?rev=1364512&r1=1364511&r2=1364512&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/DispatchContext.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/DispatchContext.java Mon Jul 23 06:35:03 2012 @@ -60,8 +60,7 @@ public class DispatchContext implements protected transient LocalDispatcher dispatcher; protected transient ClassLoader loader; - protected Map<String, Object> attributes; - protected String name; + protected final String name; private String model; /** @@ -71,31 +70,6 @@ public class DispatchContext implements this.name = name; this.model = name; // this will change when a dispatcher is set to match the model name associated to the delegator's dispatcher this.loader = loader; - this.attributes = FastMap.newInstance(); - } - - public void loadReaders() { - getGlobalServiceMap(); - } - - /** - * Returns the service attribute for the given name, or null if there is no attribute by that name. - * @param name a String specifying the name of the attribute - * @return an Object containing the value of the attribute, or null if there is no attribute by that name. - */ - public Object getAttribute(String name) { - if (attributes.containsKey(name)) - return attributes.get(name); - return null; - } - - /** - * Binds an object to a given attribute name in this context. - * @param name a String specifying the name of the attribute - * @param object an Object representing the attribute to be bound. - */ - public void setAttribute(String name, Object object) { - attributes.put(name, object); } /** @@ -218,6 +192,7 @@ public class DispatchContext implements } } } + getGlobalServiceMap(); } /** Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java?rev=1364512&r1=1364511&r2=1364512&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/GenericDispatcher.java Mon Jul 23 06:35:03 2012 @@ -92,7 +92,6 @@ public class GenericDispatcher extends G this.dispatcher.register(ctx); this.ctx = ctx; this.ctx.setDispatcher(this); - this.ctx.loadReaders(); if (Debug.verboseOn()) Debug.logVerbose("[LocalDispatcher] : Created Dispatcher for: " + name, module); } |
| Free forum by Nabble | Edit this page |
