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


Java BundleEvent.UNINSTALLED属性代码示例

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


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

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

示例2: shutdown

static void shutdown(boolean restart) {
    System.out.println("---------------------------------------------------------");
    System.out.println("  ACDD OSGi shutting down ...");
    System.out.println("  Bye !");
    System.out.println("---------------------------------------------------------");
    systemBundle.state = BundleEvent.UNINSTALLED;
    systemBundle.setLevel(getBundles().toArray(new Bundle[bundles.size()]), 0, true);
    bundles.clear();
    systemBundle.state = BundleEvent.INSTALLED;
    if (restart) {
        try {
            startup();
        } catch (Throwable th) {
            th.printStackTrace();
        }
    }
}
 
开发者ID:bunnyblue,项目名称:ACDD,代码行数:17,代码来源:Framework.java

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

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

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

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

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

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

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

示例10: 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);
	}
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:9,代码来源:ReplayEventManager.java

示例11: EclipseClassProvider

/**
 * Constructor.
 * 
 * @param context
 *            the {@link BundleContext}
 * @param classLoader
 *            the fall back {@link ClassLoader}
 */
public EclipseClassProvider(BundleContext context, ClassLoader classLoader) {
    super(classLoader);
    this.context = context;
    for (Bundle bundle : context.getBundles()) {
        bundles.put(bundle.getSymbolicName(), bundle);
    }
    listener = new BundleListener() {

        @Override
        public void bundleChanged(BundleEvent event) {
            switch (event.getType()) {
                case BundleEvent.INSTALLED:
                    bundles.put(event.getBundle().getSymbolicName(), event.getBundle());
                    break;

                case BundleEvent.UNINSTALLED:
                    bundles.remove(event.getBundle().getSymbolicName());
                    break;

                default:
                    // nothing to do here
                    break;
            }
        }
    };
    context.addBundleListener(listener);
}
 
开发者ID:ObeoNetwork,项目名称:M2Doc,代码行数:35,代码来源:EclipseClassProvider.java

示例12: bundleChanged

@Override
public void bundleChanged( BundleEvent event ) {
    long bundleId = event.getBundle().getBundleId();
    switch ( event.getType() ) {
        case BundleEvent.INSTALLED:
            subscribeBundle( bundleId );
            break;
        case BundleEvent.UNINSTALLED:
            pendingForRegistration.remove( bundleId );
            break;
    }
}
 
开发者ID:renatoathaydes,项目名称:osgiaas,代码行数:12,代码来源:AutoUpdaterService.java

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

示例14: bundleChanged

/**
 * Receives notification that the entities bundle has had a lifecycle change and checks it
 * current status.
 *
 * @param event The {@code BundleEvent}.
 */
@Override
public void bundleChanged(BundleEvent event) {
    if (isEntities(event.getBundle())) {
        LOGGER.info("Entities Bundle Status: {}", nullSafeToString(event));

        synchronized (lock) {
            int type = event.getType();

            bundleStarted = type == BundleEvent.STARTED;
            bundleInstalled = type == BundleEvent.INSTALLED;
            bundleUninstalled = type == BundleEvent.UNINSTALLED;
        }
    }
}
 
开发者ID:motech,项目名称:motech,代码行数:20,代码来源:EntitiesBundleMonitor.java

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


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