OW2 Consortium
Search OW2 Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | fractal-commits List | May 2008 Index

<--  Date Index  --> <--  Thread Index  -->

[fractal-commits] [7811] sandbox/ervalerio/fractal-bf/core/src/main/java/org/objectweb/ fractal/bf/proxies/AbstractStubComponentFactory.java: add some loggings


Title: [7811] sandbox/ervalerio/fractal-bf/core/src/main/java/org/objectweb/fractal/bf/proxies/AbstractStubComponentFactory.java: add some loggings
Revision
7811
Author
ervalerio
Date
2008-05-30 10:09:10 +0200 (Fri, 30 May 2008)

Log Message

add some loggings

Modified Paths

Diff

Modified: sandbox/ervalerio/fractal-bf/core/src/main/java/org/objectweb/fractal/bf/proxies/AbstractStubComponentFactory.java (7810 => 7811)


--- sandbox/ervalerio/fractal-bf/core/src/main/java/org/objectweb/fractal/bf/proxies/AbstractStubComponentFactory.java	2008-05-30 07:42:09 UTC (rev 7810)
+++ sandbox/ervalerio/fractal-bf/core/src/main/java/org/objectweb/fractal/bf/proxies/AbstractStubComponentFactory.java	2008-05-30 08:09:10 UTC (rev 7811)
@@ -32,7 +32,7 @@
 	 * The generic factory used to instantiate components
 	 */
 	protected GenericFactory gf;
-	protected StubContentGenerator stubContentGenerator;
+	protected StubContentGenerator<?> stubContentGenerator;
 
 	/**
 	 * Abstract implementation for proxy factories.
@@ -53,13 +53,18 @@
 
 	public Component createStubComponent(InterfaceType iType,
 			BindHints bindHints) throws InstantiationException {
+
+		log
+				.fine("Creating stub component from client interface's interface type: "
+						+ iType + " and bindHints: " + bindHints);
+
 		Class<?> clazz = null;
 		try {
 			clazz = Class.forName(iType.getFcItfSignature());
 		} catch (ClassNotFoundException e) {
 			e.printStackTrace();
 			throw new InstantiationException(
-					"Invalid InterfaceType signature: "
+					"Cannot find class for interface type: "
 							+ iType.getFcItfSignature());
 		}
 
@@ -77,25 +82,33 @@
 							+ e.getCause());
 		}
 
-		InterfaceType proxyInterfaceType = symmetricInterfaceType(iType);
-
-		ComponentType proxyType = createProxyType(proxyInterfaceType);
-
+		InterfaceType stubInterfaceType = symmetricInterfaceType(iType);
+		log.finer("Interface type for stub component created: "
+				+ stubInterfaceType);
+		ComponentType stubComponentType = createProxyType(stubInterfaceType);
+		log.finer("Component type for stub component created: "
+				+ stubComponentType);
 		Object[] ctrlDesc = new Object[] {
 				stubComponentContentInstance.getClass().getClassLoader(),
 				proxyMembraneDescriptor() };
-
-		Component proxyComponent = gf.newFcInstance(proxyType, ctrlDesc,
+		log.finest("Controller descriptor for stub component: " + ctrlDesc);
+		Component stubComponent = gf.newFcInstance(stubComponentType, ctrlDesc,
 				stubComponentContentInstance);
+		log.finer("Stub component created: " + stubComponent);
 
 		try {
-			Fractal.getNameController(proxyComponent).setFcName(
-					clazz.getCanonicalName() + "$$BindingFactoryGeneratedStub");
+			final String stubComponentFcName = clazz.getCanonicalName()
+					+ "$$BindingFactoryGeneratedStub";
+			Fractal.getNameController(stubComponent).setFcName(
+					stubComponentFcName);
+			log.finer("Stub component name set to: " + stubComponentFcName);
 		} catch (NoSuchInterfaceException e) {
 			// do nothing
+			log
+					.warning("Cannot set the name of the stub component - (cannot find NameController interface)");
 		}
 
-		return proxyComponent;
+		return stubComponent;
 	}
 
 	/**


<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 2006-2007, OW2 Consortium | contact | webmaster.