From e6b1a308a9f0d77dd6acd6da580fe3bcf5e534df Mon Sep 17 00:00:00 2001 From: Manuele Simi Date: Mon, 14 Apr 2008 17:07:57 +0000 Subject: [PATCH] git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/information-system/gCubeIS/Registry@296 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../registry/impl/core/ServiceContext.java | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/org/gcube/informationsystem/registry/impl/core/ServiceContext.java b/org/gcube/informationsystem/registry/impl/core/ServiceContext.java index 168b6a2..539ef31 100644 --- a/org/gcube/informationsystem/registry/impl/core/ServiceContext.java +++ b/org/gcube/informationsystem/registry/impl/core/ServiceContext.java @@ -60,9 +60,11 @@ public class ServiceContext extends GCUBEServiceContext { ISClient client = null; + //creates the single RegistryResource used to raise notifications about profiles' changes FactoryContext.getContext().getWSHome().create( FactoryContext.getContext().makeKey(RegistryFactory.NOTIFICATOR_RESOURCE_KEY)); + logger.info("IS-Registry notification resource registered"); // create GeneralQueryManager try { @@ -70,14 +72,14 @@ public class ServiceContext extends GCUBEServiceContext { queryRI = client.getQuery(GCUBERIsFromClassAndName.class); queryGHN = client.getQuery(GCUBEResourceXPathQuery.class); } catch (Exception e) { - e.printStackTrace(); + logger.error("Failed to create a QueryManger", e); } try { RegistryRIProfile = ServiceContext.getContext().getInstance(); - } catch (Exception e) { - e.printStackTrace(); + logger.error("Unable to get the service instance profile", e); + throw e; } try { @@ -85,37 +87,37 @@ public class ServiceContext extends GCUBEServiceContext { ROOT_SERVICES.ISNOTIFIER.getClazz(), ROOT_SERVICES.ISNOTIFIER.getName()).getInstance(); isNotifierCodeployed = true; } catch (Exception e) { - e.printStackTrace(); + logger.warn("Unable to detect if the " + ROOT_SERVICES.ISNOTIFIER.getName() + " is co-deployed"); } try { GHNManagerProfile = GHNContext.getContext().getServiceContext(ROOT_SERVICES.GHNMANAGER.getClazz(), ROOT_SERVICES.GHNMANAGER.getName()).getInstance(); } catch (Exception e) { - e.printStackTrace(); + logger.warn("Unable to detect if the " + ROOT_SERVICES.GHNMANAGER.getName() + " is co-deployed"); } try { ISICRIProfile = GHNContext.getContext().getServiceContext( ROOT_SERVICES.ISIC.getClazz(), ROOT_SERVICES.ISIC.getName()).getInstance(); isICCodeployed = true; } catch (Exception e) { - e.printStackTrace(); + logger.warn("Unable to detect if the " + ROOT_SERVICES.ISIC.getName() + " is co-deployed"); } try { ghnProfile = GHNContext.getContext().getGHN(); ghnName = ghnProfile.getNodeDescription().getName(); } catch (Exception e) { - e.printStackTrace(); + logger.error("Unable to get the GHN profile", e); + throw e; } try { Thread.sleep(20000); } catch (InterruptedException e1) { - - e1.printStackTrace(); + logger.error("Unable to get the servce instance profile", e1); } - // Check if the Registry profile is alerady registered + // Check if the Registry profile is already registered try { // registers the my profile @@ -151,15 +153,14 @@ public class ServiceContext extends GCUBEServiceContext { registerProfile(ghnProfile, GCUBEHostingNode.TYPE); } catch (Exception e) { - e.printStackTrace(); + logger.error("Failed to register co-deployed services", e); + throw e; } } @Override - protected void onInitialisation() throws Exception { - - } + protected void onInitialisation() throws Exception {} /** * Register the Profile