start(ctxt.getBundleContext());
String adminConsoleURL =
CarbonUIUtil.getAdminConsoleURL(serverConfiguration.getFirstProperty("WebContextRoot"));
//Retrieving available contexts
Context defaultContext = null;
Context defaultAdditionalContext = null;
ServiceReference reference = ctxt.getBundleContext().getServiceReference(CarbonUIDefinitions.class.getName());
CarbonUIDefinitions carbonUIDefinitions = null;
if (reference != null) {
carbonUIDefinitions =
(CarbonUIDefinitions) ctxt.getBundleContext().getService(reference);
if (carbonUIDefinitions != null) {
if (carbonUIDefinitions.getContexts().containsKey("default-context")) {
defaultContext = carbonUIDefinitions.getContexts().get("default-context");
}if (carbonUIDefinitions.getContexts().containsKey("default-additional-context")) {
defaultAdditionalContext = carbonUIDefinitions.getContexts().get("default-additional-context");
}
}
}
if (adminConsoleURL != null) {
log.info("Mgt Console URL : " + adminConsoleURL);
}
if (defaultContext != null && !"".equals(defaultContext.getContextName()) && !"null".equals(defaultContext.getContextName())) {
// Adding the other context url
int index = adminConsoleURL.lastIndexOf("carbon");
String defContextUrl = adminConsoleURL.substring(0, index) + defaultContext.getContextName();
if (defaultContext.getDescription() != null) {
if (defaultContext.getProtocol() != null && "http".equals(defaultContext.getProtocol())) {
log.info(defaultContext.getDescription() + " : " + CarbonUIUtil.https2httpURL(defContextUrl));
} else {
log.info(defaultContext.getDescription() + " : " + defContextUrl);
}
} else {
log.info("Default Context : " + defContextUrl);
}
} if (defaultAdditionalContext != null && !"".equals(defaultAdditionalContext.getContextName()) && !"null".equals(defaultAdditionalContext.getContextName())) {
// Adding the other context url
int index = adminConsoleURL.lastIndexOf("carbon");
String defContextUrl = adminConsoleURL.substring(0, index) + defaultAdditionalContext.getContextName();
if (defaultAdditionalContext.getDescription() != null) {
if (defaultAdditionalContext.getProtocol() != null && "http".equals(defaultAdditionalContext.getProtocol())) {
log.info(defaultAdditionalContext.getDescription() + " : " + CarbonUIUtil.https2httpURL(defContextUrl));
} else {
log.info(defaultAdditionalContext.getDescription() + " : " + defContextUrl);
}
} else {
log.info("Default Context : " + defContextUrl);
}
}