當前位置: 首頁>>代碼示例>>Java>>正文


Java BundleEvent.UPDATED屬性代碼示例

本文整理匯總了Java中org.osgi.framework.BundleEvent.UPDATED屬性的典型用法代碼示例。如果您正苦於以下問題:Java BundleEvent.UPDATED屬性的具體用法?Java BundleEvent.UPDATED怎麽用?Java BundleEvent.UPDATED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.osgi.framework.BundleEvent的用法示例。


在下文中一共展示了BundleEvent.UPDATED屬性的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: 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

示例3: 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

示例4: bundleChanged

@Override
public void bundleChanged(BundleEvent event) {
    switch (event.getType()) {
        case BundleEvent.INSTALLED:
        case BundleEvent.UPDATED:
            Message msg = Message.obtain();
            msg.obj = event.getBundle();
            mHandler.sendMessageDelayed(msg,3000);
            break;
        case BundleEvent.STARTED:
        case BundleEvent.STOPPED:
        case BundleEvent.UNINSTALLED:
            break;
    }
}
 
開發者ID:alibaba,項目名稱:atlas,代碼行數:15,代碼來源:SecurityHandler.java

示例5: bundleChanged

@SuppressLint("NewApi") @Override
public void bundleChanged(final BundleEvent event){
    switch (event.getType()) {
        case 0:/* LOADED */
            loaded(event.getBundle());
            break;
        case BundleEvent.INSTALLED:
            //todo 注意主dex bundle
            installed(event.getBundle());
            break;
        case BundleEvent.UPDATED:
            updated(event.getBundle());
            break;
        case BundleEvent.UNINSTALLED:
            uninstalled(event.getBundle());
            break;
        case BundleEvent.STARTED:
        	if(isLewaOS()){
        		if(Looper.myLooper() == null){
        			Looper.prepare();
        		}
                started(event.getBundle());
        	}else{
                started(event.getBundle());
        	}  
        	break;
        case BundleEvent.STOPPED:
            stopped(event.getBundle());
            break;
    }
}
 
開發者ID:alibaba,項目名稱:atlas,代碼行數:31,代碼來源:BundleLifecycleHandler.java

示例6: 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

示例7: 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

示例8: bundleChanged

public void bundleChanged(BundleEvent bundleEvent) {

        switch (bundleEvent.getType()) {
            case BundleEvent.INSTALLED:
            case BundleEvent.UPDATED:
                Message obtain = Message.obtain();
                obtain.obj = bundleEvent.getBundle().getLocation();
                this.mSecurityCheckHandler.sendMessage(obtain);
                return;
            default:
                return;
        }
    }
 
開發者ID:bunnyblue,項目名稱:ACDD,代碼行數:13,代碼來源:SecurityBundleListner.java

示例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);
    }
}
 
開發者ID:motech,項目名稱:motech,代碼行數:15,代碼來源:MdsBundleWatcher.java

示例10: bundleChanged

@Override
public void bundleChanged(BundleEvent event) {

	if (event.getType() == BundleEvent.STARTED || event.getType() == BundleEvent.UPDATED) {
		doBundle(event.getBundle(), SENSIVITY.UPDATE);
	} else
	if (event.getType() == BundleEvent.STOPPING ) {
		doDelete(event.getBundle());
	}
	
}
 
開發者ID:mhus,項目名稱:cherry-web,代碼行數:11,代碼來源:CherryDeployServlet.java

示例11: bundleChanged

@Override
public void bundleChanged(BundleEvent event) {
	if (event.getType() == BundleEvent.STOPPED || event.getType() == BundleEvent.UPDATED) {
		synchronized (bundleStore) {
			bundleStore.remove(event.getBundle().getSymbolicName());
		}
	}
}
 
開發者ID:mhus,項目名稱:cherry-web,代碼行數:8,代碼來源:InternalCherryApiImpl.java

示例12: 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

示例13: bundleChanged

@Override
@SuppressLint({"NewApi"})
public void bundleChanged(BundleEvent bundleEvent) {
    switch (bundleEvent.getType()) {
        case BundleEvent.LOADED:
            loaded(bundleEvent.getBundle());
            break;
        case BundleEvent.INSTALLED:
            installed(bundleEvent.getBundle());
            break;
        case BundleEvent.STARTED:
            if (isLewaOS()) {
                if (Looper.myLooper() == null) {
                    Looper.prepare();
                }
                started(bundleEvent.getBundle());
            } else if (Framework.isFrameworkStartupShutdown()) {
                BundleStartTask bundleStartTask = new BundleStartTask();
                if (VERSION.SDK_INT > 11) {
                    bundleStartTask.executeOnExecutor(
                            AsyncTask.THREAD_POOL_EXECUTOR,
                            bundleEvent.getBundle());
                    return;
                }
                bundleStartTask
                        .execute(bundleEvent.getBundle());
            } else {
                started(bundleEvent.getBundle());
            }
            break;
        case BundleEvent.STOPPED:
            stopped(bundleEvent.getBundle());
            break;
        case BundleEvent.UPDATED:
            updated(bundleEvent.getBundle());
            break;
        case BundleEvent.UNINSTALLED:

        {
            uninstalled(bundleEvent.getBundle());
            break;
        }
        default:
    }
}
 
開發者ID:bunnyblue,項目名稱:ACDD,代碼行數:45,代碼來源:BundleLifecycleHandler.java

示例14: launch

private static void launch() {
    STORAGE_LOCATION = properties.getProperty(InternalConstant.INSTALL_LOACTION, properties.getProperty("org.osgi.framework.dir", BASEDIR + File.separatorChar + "storage"))
            + File.separatorChar;
    systemBundle = new SystemBundle();
    systemBundle.state = BundleEvent.UPDATED;
}
 
開發者ID:bunnyblue,項目名稱:ACDD,代碼行數:6,代碼來源:Framework.java

示例15: 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());
}
 
開發者ID:to2mbn,項目名稱:LoliXL,代碼行數:64,代碼來源:OSGiListener.java


注:本文中的org.osgi.framework.BundleEvent.UPDATED屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。