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


Java ComponentInstance.dispose方法代码示例

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


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

示例1: testUnbindMessageHandler

import org.apache.felix.ipojo.ComponentInstance; //导入方法依赖的package包/类
/**
 * Test unbind message handler.
 */
@Test
public void testUnbindMessageHandler() {

    ComponentInstance componentInstanceMock = EasyMock
            .createMock(ComponentInstance.class);

    EasyMock.expect(messageConsumersMock.remove(testHandlerMock))
            .andReturn(componentInstanceMock);
    componentInstanceMock.dispose();

    EasyMock.replay(componentInstanceMock, messageConsumersMock);

    ProviderMessageConsumerFactoryImpl factory = new ProviderMessageConsumerFactoryImpl();
    factory.setMessageConsumerFactory(messageConsumerFactoryMock);
    factory.setMessageConsumers(messageConsumersMock);
    factory.unbindMessageHandler(testHandlerMock);
    EasyMock.verify(componentInstanceMock);

}
 
开发者ID:Communote,项目名称:communote-server,代码行数:23,代码来源:ProviderMessageConsumerFactoryTest.java

示例2: unbindMessageHandler

import org.apache.felix.ipojo.ComponentInstance; //导入方法依赖的package包/类
/**
 * 
 * Is invoked when a communote message handler is removed from the OSGi context. The method is
 * responsible for stopping appropriate provider message consumer instance
 * 
 * @param messageHandler
 *            message handler, that was removed
 */
@Override
@Unbind
public void unbindMessageHandler(
        CommunoteMessageHandler<? extends BaseMessage> messageHandler) {
    ComponentInstance consumerToBeRemoved = messageConsumers.remove(messageHandler);
    if (consumerToBeRemoved != null) {
        consumerToBeRemoved.dispose();
        LOG.debug("Provider message consumer has been unbound");
    } else {
        LOG.warn("Provider message consumer for the removed message handler was not found. MessageHandler == "
                + messageHandler);
    }
}
 
开发者ID:Communote,项目名称:communote-server,代码行数:22,代码来源:ProviderMessageConsumerFactoryImpl.java

示例3: deleteIPojoInstance

import org.apache.felix.ipojo.ComponentInstance; //导入方法依赖的package包/类
private void deleteIPojoInstance( ComponentInstance instance ) {

		String userDataFilePath = this.ipojoNameToUserDataFile.get( instance.getInstanceName());
		if( userDataFilePath != null )
			Utils.deleteFilesRecursivelyAndQuietly( new File( userDataFilePath ));

		instance.dispose();
	}
 
开发者ID:roboconf,项目名称:roboconf-platform,代码行数:9,代码来源:InMemoryHandler.java

示例4: killInstance

import org.apache.felix.ipojo.ComponentInstance; //导入方法依赖的package包/类
private boolean killInstance(String name) throws InvalidSyntaxException, NoSuchFieldException, IllegalAccessException {
    ComponentInstance instance = getComponentInstance(name);
    if (instance == null) {
        return false;
    }
    // FATALITY!!!
    instance.dispose();
    return true;
}
 
开发者ID:ow2-chameleon,项目名称:everest,代码行数:10,代码来源:EverestIpojoTestCommon.java

示例5: tearDownFinal

import org.apache.felix.ipojo.ComponentInstance; //导入方法依赖的package包/类
@After
public void tearDownFinal() {
    ComponentInstance importer = ipojoHelper.getInstanceByName(IMPORTER_NAME);
    if (importer != null) {
        importer.dispose();
    }
    if (httpServer != null) {
        httpServer.stop(0);
        httpServer = null;
    }
}
 
开发者ID:ow2-chameleon,项目名称:fuchsia,代码行数:12,代码来源:JSONRPCImporterTest.java

示例6: denyImportDeclaration

import org.apache.felix.ipojo.ComponentInstance; //导入方法依赖的package包/类
@Override
public void denyImportDeclaration(ImportDeclaration importDeclaration) throws BinderException {
    String id = (String) importDeclaration.getMetadata().get(ID);
    unhandleImportDeclaration(importDeclaration);
    if (clients.containsKey(id)) {
        String klassName = (String) importDeclaration.getMetadata().get(SERVICE_CLASS);
        if (klassName != null) {
            // Unregister the proxy from OSGi
            ServiceRegistration sReg = registrations.remove(id);
            if (sReg != null) {
                sReg.unregister();
            } else {
                throw new IllegalStateException("The serviceRegistration of the given object is null." +
                        "It could not be unregister.");
            }
        } else {
            ComponentInstance componentInstance = componentInstances.remove(id);
            if (componentInstance != null) {
                componentInstance.dispose();
            }
        }
        // Remove the client
        clients.remove(id);
    } else {
        throw new BinderException("The given object has not been created through this factory");
    }
}
 
开发者ID:ow2-chameleon,项目名称:fuchsia,代码行数:28,代码来源:JSONRPCImporter.java

示例7: dispose

import org.apache.felix.ipojo.ComponentInstance; //导入方法依赖的package包/类
@Override
public void dispose() {
    for (ComponentInstance instance : instances) {
        instance.dispose();
    }
}
 
开发者ID:ow2-chameleon,项目名称:osgi-testing-helpers,代码行数:7,代码来源:InstanceCreationHelper.java


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