本文整理汇总了Java中org.osgi.framework.BundleEvent.UNRESOLVED属性的典型用法代码示例。如果您正苦于以下问题:Java BundleEvent.UNRESOLVED属性的具体用法?Java BundleEvent.UNRESOLVED怎么用?Java BundleEvent.UNRESOLVED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.osgi.framework.BundleEvent
的用法示例。
在下文中一共展示了BundleEvent.UNRESOLVED属性的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBundleEventTypeText
private String getBundleEventTypeText(int type) {
switch (type) {
case BundleEvent.INSTALLED:
return "Installed";
case BundleEvent.RESOLVED:
return "Resolved";
case BundleEvent.LAZY_ACTIVATION:
return "Lazy Activation";
case BundleEvent.STARTING:
return "Starting";
case BundleEvent.STARTED:
return "Started";
case BundleEvent.STOPPING:
return "Stopping";
case BundleEvent.STOPPED:
return "Stopped";
case BundleEvent.UPDATED:
return "Updated";
case BundleEvent.UNRESOLVED:
return "Unresolved";
case BundleEvent.UNINSTALLED:
return "Uninstalled";
default:
return type + " ???";
}
}
示例2: getBundleEventAsString
/**
* Returns the specified bundle event as string.
* @param event the bundle event
* @return the bundle event as string
*/
private String getBundleEventAsString(BundleEvent event) {
if (event == null) return "null";
int type = event.getType();
switch (type) {
case BundleEvent.INSTALLED:
return "INSTALLED";
case BundleEvent.LAZY_ACTIVATION:
return "LAZY_ACTIVATION";
case BundleEvent.RESOLVED:
return "RESOLVED";
case BundleEvent.STARTED:
return "STARTED";
case BundleEvent.STARTING:
return "STARTING";
case BundleEvent.STOPPED:
return "STOPPED";
case BundleEvent.UNINSTALLED:
return "UNINSTALLED";
case BundleEvent.UNRESOLVED:
return "UNRESOLVED";
case BundleEvent.UPDATED:
return "UPDATED";
default:
return "unknown event type: " + type;
}
}
示例3: bundleChanged
@Override
public void bundleChanged(BundleEvent event) {
if ((event.getType() & (BundleEvent.RESOLVED)) != 0) {
handlePotentialEclipseLink(event.getBundle());
} else if (event.getType() == BundleEvent.UNRESOLVED || event.getType() == BundleEvent.UNINSTALLED) {
ServiceRegistration<?> reg = registeredProviders.remove(event.getBundle());
if (reg != null) {
reg.unregister();
}
}
}
示例4: bundleChanged
@Override
public void bundleChanged(BundleEvent event) {
int mask = BundleEvent.INSTALLED | BundleEvent.RESOLVED | BundleEvent.UNRESOLVED | BundleEvent.UPDATED | BundleEvent.UNINSTALLED;
if ((mask & event.getType()) > 0) {
invalidateAllUnits(String.format("Bundle %s entered state %s", event.getBundle().getSymbolicName(), bundleEventToString(event.getType())));
}
}
示例5: bundleEventToString
private static String bundleEventToString(int type) {
String s;
switch (type) {
case BundleEvent.INSTALLED:
s = "INSTALLED";
break;
case BundleEvent.RESOLVED:
s = "RESOLVED";
break;
case BundleEvent.STARTING:
s = "STARTING";
break;
case BundleEvent.STARTED:
s = "STARTED";
break;
case BundleEvent.STOPPING:
s = "STOPPING";
break;
case BundleEvent.STOPPED:
s = "STOPPED";
break;
case BundleEvent.UNRESOLVED:
s = "UNRESOLVED";
break;
case BundleEvent.UPDATED:
s = "UPDATED";
break;
case BundleEvent.UNINSTALLED:
s = "UNINSTALLED";
break;
case BundleEvent.LAZY_ACTIVATION:
s = "LAZY_ACTIVATION";
break;
default:
s = "UNKNOWN";
}
return s;
}
示例6: bundleChanged
public void bundleChanged(BundleEvent event) {
if (BundleEvent.STOPPED == event.getType() || BundleEvent.UNINSTALLED == event.getType()
|| BundleEvent.UNRESOLVED == event.getType()) {
BlueprintEvent removed = events.remove(event.getBundle());
if (log.isTraceEnabled())
log.trace("Removed bundle " + event.getBundle() + " for sending replayes events; last one was "
+ removed);
}
}
示例7: bundleChanged
@Override
public void bundleChanged(BundleEvent event) {
switch (event.getType()) {
case BundleEvent.UNRESOLVED:
// only create new wiring to flush out old stuff
createNewWiringLayers();
break;
default:
break;
}
}
示例8: bundleChanged
public void bundleChanged(BundleEvent event) {
if (event.getType() == BundleEvent.RESOLVED) {
register(event.getBundle());
} else if (event.getType() == BundleEvent.UNRESOLVED || event.getType() == BundleEvent.UNINSTALLED) {
unregister(event.getBundle().getBundleId());
}
}
示例9: handleBundleEvent
private void handleBundleEvent(final Bundle bundle, final int eventType) {
if (eventType == BundleEvent.INSTALLED || eventType == BundleEvent.UPDATED) {
if (processingSuspended) {
awaitingBundles.add(new AwaitingBundle(bundle, eventType));
} else {
processSingleBundle(bundle);
}
} else if (eventType == BundleEvent.UNRESOLVED && !skipBundle(bundle)) {
LOGGER.info("Unregistering JDO classes for Bundle: {}", bundle.getSymbolicName());
MdsBundleHelper.unregisterBundleJDOClasses(bundle);
} else if (eventType == BundleEvent.UNINSTALLED && !skipBundle(bundle)) {
SchemaHolder schemaHolder = lockAndGetSchema();
refreshBundle(bundle, schemaHolder);
}
}
示例10: bundleChanged
@Override
public void bundleChanged( BundleEvent bundleEvent ) {
final Bundle bundle = bundleEvent.getBundle();
final int bundleEventType = bundleEvent.getType();
if ( bundleEventType == BundleEvent.STARTED ) {
addBundle( bundle );
} else if ( bundleEventType == BundleEvent.UNINSTALLED
|| bundleEventType == BundleEvent.UNRESOLVED
|| bundleEventType == BundleEvent.STOPPED ) {
removeBundle( bundle );
}
}
示例11: bundleEventType2String
private static final String bundleEventType2String(int bundleEventType) {
switch (bundleEventType) {
case BundleEvent.INSTALLED:
// The bundle has been installed.
return "INSTALLED";
case BundleEvent.LAZY_ACTIVATION:
// The bundle will be lazily activated
return "LAZY_ACTIVATION";
case BundleEvent.RESOLVED:
// The bundle has been resolved
return "RESOLVED";
case BundleEvent.STARTED:
// The bundle has been started
return "STARTED";
case BundleEvent.STARTING:
// The bundle is about to be activated
return "STARTING";
case BundleEvent.STOPPED:
// The bundle has been stopped
return "STOPPED";
case BundleEvent.STOPPING:
// The bundle is about to deactivated
return "STOPPING";
case BundleEvent.UNINSTALLED:
// The bundle has been uninstalled
return "UNINSTALLED";
case BundleEvent.UNRESOLVED:
// The bundle has been unresolved
return "UNRESOLVED";
case BundleEvent.UPDATED:
// The bundle has been updated
return "UPDATED";
default:
return "UNKNOWN_BUNDLE_EVENT_TYPE";
}
}
示例12: bundleChanged
public void bundleChanged(BundleEvent event) {
Bundle bundle = event.getBundle();
if(log.isDebugEnabled()){
log.debug("Received new bundle event : " + event.getType());
}
try {
switch (event.getType()) {
//TODO need to fix here.
case BundleEvent.RESOLVED:
if(log.isDebugEnabled()){
log.debug("Add ui component event received....");
}
processUIBundle(bundle, CarbonConstants.ADD_UI_COMPONENT);
break;
case BundleEvent.UNRESOLVED:
if(log.isDebugEnabled()){
log.debug("Remove ui component event received....");
}
processUIBundle(bundle, CarbonConstants.REMOVE_UI_COMPONENT);
break;
}
} catch (Exception e) {
log.error("Error occured when processing component xml in bundle " + bundle.getSymbolicName(), e);
e.printStackTrace();
}
}
示例13: bundleChanged
@Override
public void bundleChanged(BundleEvent event) {
String type;
Level level;
switch (event.getType()) {
case BundleEvent.INSTALLED:
level = Level.INFO;
type = "INSTALLED";
break;
case BundleEvent.RESOLVED:
level = Level.FINE;
type = "RESOLVED";
break;
case BundleEvent.LAZY_ACTIVATION:
level = Level.FINE;
type = "LAZY_ACTIVATION";
break;
case BundleEvent.STARTING:
level = Level.FINE;
type = "STARTING";
break;
case BundleEvent.STARTED:
level = Level.INFO;
type = "STARTED";
break;
case BundleEvent.STOPPING:
level = Level.FINE;
type = "STOPPING";
break;
case BundleEvent.STOPPED:
level = Level.INFO;
type = "STOPPED";
break;
case BundleEvent.UPDATED:
level = Level.INFO;
type = "UPDATED";
break;
case BundleEvent.UNRESOLVED:
level = Level.FINE;
type = "UNRESOLVED";
break;
case BundleEvent.UNINSTALLED:
level = Level.INFO;
type = "UNINSTALLED";
break;
default:
level = Level.OFF;
type = "<Unknown type: " + event.getType() + ">";
break;
}
StringBuilder sb = new StringBuilder();
sb.append(type);
if (event.getBundle() != null) {
sb.append(" bundle=[")
.append(event.getBundle())
.append("]");
}
if (event.getOrigin() != null) {
sb.append(" origin=[")
.append(event.getOrigin())
.append("]");
}
LOGGER_BUNDLE.log(level, sb.toString());
}