当前位置: 首页>>代码示例>>Java>>正文


Java BundleEvent.RESOLVED属性代码示例

本文整理汇总了Java中org.osgi.framework.BundleEvent.RESOLVED属性的典型用法代码示例。如果您正苦于以下问题:Java BundleEvent.RESOLVED属性的具体用法?Java BundleEvent.RESOLVED怎么用?Java BundleEvent.RESOLVED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.osgi.framework.BundleEvent的用法示例。


在下文中一共展示了BundleEvent.RESOLVED属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startBundle

public synchronized void startBundle() throws BundleException {
    if (this.state == BundleEvent.INSTALLED) {
        throw new IllegalStateException("Cannot start uninstalled bundle "
                + toString());
    } else if (this.state != BundleEvent.RESOLVED) {
        if (this.state == BundleEvent.STARTED) {
            resolveBundle(true);
        }
        this.state = BundleEvent.UPDATED;
        try {

            isValid = true;
            this.state = BundleEvent.RESOLVED;
            Framework.notifyBundleListeners(BundleEvent.STARTED, this);
            if (Framework.DEBUG_BUNDLES && log.isInfoEnabled()) {
                log.info("Framework: Bundle " + toString() + " started.");
            }
        } catch (Throwable th) {

            Framework.clearBundleTrace(this);
            this.state = BundleEvent.STOPPED;
            String msg = "Error starting bundle " + toString();
            log.error(msg,th);
        }
    }
}
 
开发者ID:bunnyblue,项目名称:ACDD,代码行数:26,代码来源:BundleImpl.java

示例2: stopBundle

public synchronized void stopBundle() throws BundleException {
    if (this.state == BundleEvent.INSTALLED) {
        throw new IllegalStateException("Cannot stop uninstalled bundle "
                + toString());
    } else if (this.state == BundleEvent.RESOLVED) {
        this.state = BundleEvent.UNINSTALLED;
        try {
            if (Framework.DEBUG_BUNDLES && log.isInfoEnabled()) {
                log.info("Framework: Bundle " + toString() + " stopped.");
            }
            Framework.clearBundleTrace(this);
            this.state = BundleEvent.STOPPED;
            Framework.notifyBundleListeners(BundleEvent.STOPPED, this);
            isValid = false;
        } catch (Throwable th) {

            Framework.clearBundleTrace(this);
            this.state = BundleEvent.STOPPED;
            Framework.notifyBundleListeners(BundleEvent.STOPPED, this);
            isValid = false;
        }
    }
}
 
开发者ID:bunnyblue,项目名称:ACDD,代码行数:23,代码来源:BundleImpl.java

示例3: uninstall

@Override
public synchronized void uninstall() throws BundleException {
    if (this.state == BundleEvent.INSTALLED) {
        throw new IllegalStateException("Bundle " + toString() + " is already uninstalled.");
    }
    if (this.state == BundleEvent.RESOLVED) {
        try {
            stopBundle();
        } catch (Throwable th) {
            Framework.notifyFrameworkListeners(BundleEvent.STARTED, this, th);
        }
    }
    this.state = BundleEvent.INSTALLED;
    new File(this.bundleDir, "meta").delete();
    this.classloader.cleanup(true);
    this.classloader = null;
    Framework.bundles.remove(this);
    Framework.notifyBundleListeners(BundleEvent.UNINSTALLED, this);
    isValid = false;



}
 
开发者ID:bunnyblue,项目名称:ACDD,代码行数:23,代码来源:BundleImpl.java

示例4: 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 + " ???";
        }
}
 
开发者ID:vorburger,项目名称:ch.vorburger.minecraft.osgi,代码行数:26,代码来源:LoggingBundleListener.java

示例5: 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;
	}
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:33,代码来源:PlugInActivator.java

示例6: 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();
        }
    }
}
 
开发者ID:apache,项目名称:aries-jpa,代码行数:11,代码来源:Activator.java

示例7: 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())));
    }
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:7,代码来源:DeploymentInstaller.java

示例8: 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;
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:38,代码来源:DeploymentInstaller.java

示例9: handleEvent

protected void handleEvent(BundleEvent event) {
    Bundle bundle = event.getBundle();

    switch (event.getType()) {

        case BundleEvent.RESOLVED:
            if (resolved) {
                this.namespaceHandlerActivator.maybeAddNamespaceHandlerFor(bundle, false);
            }
            break;

        case LAZY_ACTIVATION_EVENT_TYPE: {
            if (!resolved) {
                push(bundle);
                this.namespaceHandlerActivator.maybeAddNamespaceHandlerFor(bundle, true);
            }
            break;
        }
        case BundleEvent.STARTED: {
            if (!resolved) {
                if (!pop(bundle)) {
                    this.namespaceHandlerActivator.maybeAddNamespaceHandlerFor(bundle, false);
                }
            }
            break;
        }
        case BundleEvent.STOPPED: {
            pop(bundle);
            this.namespaceHandlerActivator.maybeRemoveNameSpaceHandlerFor(bundle);
            break;
        }
        default:
            break;
    }
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:35,代码来源:NamespaceBundleLister.java

示例10: setBundleStartLevel

@Override
public void setBundleStartLevel(Bundle bundle, int level) {
    if (bundle == this) {
        throw new IllegalArgumentException("Cannot set the start level for the system bundle.");
    }
    BundleImpl bundleImpl = (BundleImpl) bundle;
    if (bundleImpl.state == BundleEvent.INSTALLED) {
        throw new IllegalArgumentException("Bundle " + bundle + " has been uninstalled");
    } else if (level <= 0) {
        throw new IllegalArgumentException("Start level " + level + " is not Component valid level");
    } else {
        bundleImpl.currentStartlevel = level;
        bundleImpl.updateMetadata();
        if (level <= Framework.startlevel && bundle.getState() != BundleEvent.RESOLVED && bundleImpl.persistently) {
            try {
                bundleImpl.startBundle();
            } catch (Throwable e) {
                e.printStackTrace();
                Framework.notifyFrameworkListeners(BundleEvent.STARTED, bundle, e);
            }
        } else if (level <= Framework.startlevel) {
        } else {
            if (bundle.getState() != BundleEvent.STOPPED || bundle.getState() != BundleEvent.STARTED) {
                try {
                    bundleImpl.stopBundle();
                } catch (Throwable e2) {
                    Framework.notifyFrameworkListeners(BundleEvent.STARTED, bundle, e2);
                }
            }
        }
    }
}
 
开发者ID:bunnyblue,项目名称:ACDD,代码行数:32,代码来源:Framework.java

示例11: bundleChanged

public void bundleChanged(BundleEvent event) {
    Bundle bundle = event.getBundle();
    if (event.getType() == BundleEvent.RESOLVED) {
        checkBundle(bundle);
    } else if (event.getType() == BundleEvent.STARTED) {
        checkBundleScriptEngines(bundle);
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:8,代码来源:Extender.java

示例12: 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());
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:7,代码来源:Activator.java

示例13: 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";
	}
}
 
开发者ID:dana-i2cat,项目名称:mqnaas,代码行数:36,代码来源:BundleGuard.java

示例14: 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();
    }
}
 
开发者ID:apache,项目名称:stratos,代码行数:27,代码来源:UIBundleDeployer.java

示例15: notifyBundleChange

final void notifyBundleChange(final String symbolicName, final Version version, final int action) {
    final Exception stack = Netigso.LOG.isLoggable(Level.FINER) ? new Exception("StackTrace") : null;
    final Runnable doLog = new Runnable() {
        @Override
        public void run() {
            if (isEnabled(symbolicName)) {
                return;
            }
            final Mutex mutex = Main.getModuleSystem().getManager().mutex();
            if (!mutex.isReadAccess()) {
                mutex.postReadRequest(this);
                return;
            }
            String type = "" + action;
            Level notify = Level.INFO;
            switch (action) {
                case BundleEvent.INSTALLED:
                    return; // no message for installed
                case BundleEvent.RESOLVED:
                    type = "resolved";
                    break;
                case BundleEvent.STARTED:
                    type = "started";
                    break;
                case BundleEvent.STOPPED:
                    type = "stopped";
                    break;
                case BundleEvent.UNINSTALLED:
                    return; // nothing for uninstalled
                case BundleEvent.LAZY_ACTIVATION:
                    type = "lazy";
                    notify = Level.FINEST;
                    break;
                case BundleEvent.STARTING:
                    type = "starting";
                    notify = Level.FINEST;
                    break;
            }
            Netigso.LOG.log(notify, "bundle {0}@{2} {1}", new Object[]{
                        symbolicName, type, version
                    });
            if (stack != null) {
                Netigso.LOG.log(Level.FINER, null, stack);
            }
        }
    };
    RP.post(doLog);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:48,代码来源:Netigso.java


注:本文中的org.osgi.framework.BundleEvent.RESOLVED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。