Search in sources :

Example 1 with BootstrappingDependencyEvent

use of org.springframework.osgi.extender.event.BootstrappingDependencyEvent in project karaf by apache.

the class SpringStateService method getDiag.

public String getDiag(Bundle bundle) {
    OsgiBundleApplicationContextEvent event = states.get(bundle.getBundleId());
    if (event == null) {
        return null;
    }
    StringBuilder message = new StringBuilder();
    Date date = new Date(event.getTimestamp());
    SimpleDateFormat df = new SimpleDateFormat();
    message.append(df.format(date) + "\n");
    if (event instanceof BootstrappingDependencyEvent) {
        message.append(getServiceInfo((BootstrappingDependencyEvent) event));
    }
    Throwable ex = getException(event);
    if (ex != null) {
        message.append("Exception: \n");
        addMessages(message, ex);
    }
    return message.toString();
}
Also used : OsgiBundleApplicationContextEvent(org.springframework.osgi.context.event.OsgiBundleApplicationContextEvent) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date) BootstrappingDependencyEvent(org.springframework.osgi.extender.event.BootstrappingDependencyEvent)

Aggregations

SimpleDateFormat (java.text.SimpleDateFormat)1 Date (java.util.Date)1 OsgiBundleApplicationContextEvent (org.springframework.osgi.context.event.OsgiBundleApplicationContextEvent)1 BootstrappingDependencyEvent (org.springframework.osgi.extender.event.BootstrappingDependencyEvent)1