[jboss-svn-commits] JBL Code SVN: r32427 - labs/jbossrules/trunk/drools-grid/drools-grid-core/src/main/java/org/drools/grid.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Apr 5 16:04:25 EDT 2010
Author: salaboy21
Date: 2010-04-05 16:04:24 -0400 (Mon, 05 Apr 2010)
New Revision: 32427
Removed:
labs/jbossrules/trunk/drools-grid/drools-grid-core/src/main/java/org/drools/grid/ExecutionNode.java
Log:
JBRULES-2446: Drools Services API\n -drools-grid-core remove ExecutionNode
Deleted: labs/jbossrules/trunk/drools-grid/drools-grid-core/src/main/java/org/drools/grid/ExecutionNode.java
===================================================================
--- labs/jbossrules/trunk/drools-grid/drools-grid-core/src/main/java/org/drools/grid/ExecutionNode.java 2010-04-05 20:03:00 UTC (rev 32426)
+++ labs/jbossrules/trunk/drools-grid/drools-grid-core/src/main/java/org/drools/grid/ExecutionNode.java 2010-04-05 20:04:24 UTC (rev 32427)
@@ -1,71 +0,0 @@
-/*
- * Copyright 2010 salaboy.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * under the License.
- */
-package org.drools.grid;
-
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- *
- * @author salaboy
- */
-public class ExecutionNode {
-
- private String id;
- private final Map<Class<?>, Object> services = new ConcurrentHashMap<Class<?>, Object>();
-
- public ExecutionNode() {
- this.id = UUID.randomUUID().toString();
- }
-
- public ExecutionNode(String id) {
- this.id = id;
- }
-
- public <T> T get(Class<T> interfaceClass) {
- synchronized (interfaceClass) {
- Object service = services.get(interfaceClass);
- if (service == null) {
- try {
- Class<?> implementingClass = Class.forName(interfaceClass.getCanonicalName() + "Impl");
-
- service = implementingClass.newInstance();
- services.put(interfaceClass, service);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- return interfaceClass.cast(service);
- }
- }
-
- public <T> void set(Class<T> interfaceClass, T provider) {
- synchronized (interfaceClass) {
- services.put(interfaceClass, provider);
- }
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
-}
More information about the jboss-svn-commits
mailing list