From: <ju...@us...> - 2008-09-09 21:49:08
|
Revision: 7032 http://smartfrog.svn.sourceforge.net/smartfrog/?rev=7032&view=rev Author: julgui Date: 2008-09-09 21:49:05 +0000 (Tue, 09 Sep 2008) Log Message: ----------- OSGi merge. Modified Paths: -------------- branches/core-branch-osgi/smartfrog/src/org/smartfrog/SFSystem.java branches/core-branch-osgi/smartfrog/src/org/smartfrog/sfcore/componentdescription/ComponentDescriptionImpl.java branches/core-branch-osgi/smartfrog/src/org/smartfrog/sfcore/prim/PrimImpl.java Modified: branches/core-branch-osgi/smartfrog/src/org/smartfrog/SFSystem.java =================================================================== --- branches/core-branch-osgi/smartfrog/src/org/smartfrog/SFSystem.java 2008-09-09 16:43:54 UTC (rev 7031) +++ branches/core-branch-osgi/smartfrog/src/org/smartfrog/SFSystem.java 2008-09-09 21:49:05 UTC (rev 7032) @@ -419,6 +419,7 @@ //SmartFrog version info showVersionInfo(); + logInitStatus(); //read command line options @@ -647,10 +648,12 @@ // Read init properties readPropertiesFromIniFile(); - sfLog(); // Init special static properties Logger.init(); + + sfLog(); + //Notifies any possible problem with security init. checkSecurityStatus(); alreadySystemInit = true; Modified: branches/core-branch-osgi/smartfrog/src/org/smartfrog/sfcore/componentdescription/ComponentDescriptionImpl.java =================================================================== --- branches/core-branch-osgi/smartfrog/src/org/smartfrog/sfcore/componentdescription/ComponentDescriptionImpl.java 2008-09-09 16:43:54 UTC (rev 7031) +++ branches/core-branch-osgi/smartfrog/src/org/smartfrog/sfcore/componentdescription/ComponentDescriptionImpl.java 2008-09-09 21:49:05 UTC (rev 7032) @@ -1216,16 +1216,14 @@ * @throws SmartFrogException In case of SmartFrog system error */ public static ComponentDescription getClassComponentDescription (Object obj, boolean addSystemProperties, Vector newPhases,String languageExtension) throws SmartFrogException { - ComponentDescription cmpDesc; + ComponentDescription cmpDesc=null; //Get Component description for this obj class String className = obj.getClass().toString(); if (obj instanceof java.lang.String) className = obj.toString(); if (className.startsWith("class ")) { className = className.substring(6); } - // If system has not been initialized then the basic classloader is not in place and resources (descriptions) cannot be loaded! - //@todo review this flag name used as system flag init. Needs a better name or a different flag - if (Logger.initialized()) { + try { String tempClassName = className.replace('.','/'); String urlDescription = tempClassName+"."+languageExtension; Reference selectedRef = new Reference (tempClassName.substring(tempClassName.lastIndexOf("/")+1)); @@ -1243,11 +1241,15 @@ } // Get componentDescription and Entry cmpDesc = ComponentDescriptionImpl.sfComponentDescription( urlDescription.toLowerCase(),phases, selectedRef); - } else { //Empty description so that the system properties can still be added. - cmpDesc = new ComponentDescriptionImpl (null,null,true); + } catch (Exception ex) { + if ((sfLog!= null) && sfLog.isErrorEnabled()){ sfLog.error(ex.getMessage() + ". Continuing",ex);} + else { + ex.printStackTrace(); + } } + if (cmpDesc==null)cmpDesc = new ComponentDescriptionImpl (null,null,true); if (addSystemProperties){ //add properties that start with package name. cmpDesc = ComponentDescriptionImpl.addSystemProperties( className+".", cmpDesc, languageExtension); Modified: branches/core-branch-osgi/smartfrog/src/org/smartfrog/sfcore/prim/PrimImpl.java =================================================================== --- branches/core-branch-osgi/smartfrog/src/org/smartfrog/sfcore/prim/PrimImpl.java 2008-09-09 16:43:54 UTC (rev 7031) +++ branches/core-branch-osgi/smartfrog/src/org/smartfrog/sfcore/prim/PrimImpl.java 2008-09-09 21:49:05 UTC (rev 7032) @@ -87,7 +87,7 @@ /** * Component Log. This log is used to from any component. It can be replaced using sfSetLog() */ - private LogSF sfLog = LogFactory.sfGetProcessLog(); + private LogSF sfLog = null; /** * Static attribute that hold the lifecycle hooks for sfDeploy. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |