This commit is contained in:
Manuele Simi 2008-04-14 17:07:57 +00:00
parent cb8c9e3ae1
commit e6b1a308a9
1 changed files with 15 additions and 14 deletions

View File

@ -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