本文整理汇总了Java中org.osgi.framework.ServiceEvent.MODIFIED_ENDMATCH属性的典型用法代码示例。如果您正苦于以下问题:Java ServiceEvent.MODIFIED_ENDMATCH属性的具体用法?Java ServiceEvent.MODIFIED_ENDMATCH怎么用?Java ServiceEvent.MODIFIED_ENDMATCH使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.osgi.framework.ServiceEvent
的用法示例。
在下文中一共展示了ServiceEvent.MODIFIED_ENDMATCH属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: serviceChanged
@Override
public void serviceChanged(ServiceEvent event) {
if (closed) {
return;
}
ServiceReference<?> sr = event.getServiceReference();
switch (event.getType()) {
case ServiceEvent.REGISTERED:
onServiceRegistration(sr);
break;
case ServiceEvent.MODIFIED:
onServiceUpdate(sr);
break;
case ServiceEvent.MODIFIED_ENDMATCH:
case ServiceEvent.UNREGISTERING:
onServiceDeparture(sr);
break;
}
}
示例2: serviceChanged
@Override
public void serviceChanged(final ServiceEvent serviceEvent) {
switch(serviceEvent.getType()) {
case ServiceEvent.REGISTERED:
registerWithOnmsRegistry(serviceEvent.getServiceReference());
break;
case ServiceEvent.MODIFIED:
registerWithOnmsRegistry(serviceEvent.getServiceReference());
break;
case ServiceEvent.MODIFIED_ENDMATCH:
unregisterWithOnmsRegistry(serviceEvent.getServiceReference());
break;
case ServiceEvent.UNREGISTERING:
unregisterWithOnmsRegistry(serviceEvent.getServiceReference());
break;
}
}
示例3: handleServiceChanged
protected synchronized void handleServiceChanged ( final ServiceEvent event )
{
switch ( event.getType () )
{
case ServiceEvent.UNREGISTERING:
case ServiceEvent.MODIFIED_ENDMATCH:
removeService ( event.getServiceReference () );
break;
case ServiceEvent.REGISTERED:
addService ( event.getServiceReference () );
break;
}
}
示例4: getServiceEventTypeText
private String getServiceEventTypeText(int type) {
switch (type) {
case ServiceEvent.REGISTERED:
return "Registered";
case ServiceEvent.MODIFIED:
return "Modified";
case ServiceEvent.MODIFIED_ENDMATCH:
return "Modified End Match";
case ServiceEvent.UNREGISTERING:
return "Unregistering";
default:
return type + " ???";
}
}
示例5: serviceChanged
@Override
public void serviceChanged(final ServiceEvent aEvent) {
final ServiceReference<?> svcRef = aEvent.getServiceReference();
switch (aEvent.getType()) {
case ServiceEvent.REGISTERED:
// New service to export
exportService(svcRef);
break;
case ServiceEvent.MODIFIED:
if (pServiceUids.containsKey(svcRef)) {
// Already known service
updateService(svcRef);
} else {
// New match
exportService(svcRef);
}
break;
case ServiceEvent.MODIFIED_ENDMATCH:
case ServiceEvent.UNREGISTERING:
// Service must not be exported
unexportService(svcRef);
break;
default:
break;
}
}
示例6: testServiceChangedOtherEvents
public void testServiceChangedOtherEvents() {
ServiceHandlerCatalog shc = mock(ServiceHandlerCatalog.class);
BundleContext bc = mock(BundleContext.class);
ServiceJockeyListener sjl = new ServiceJockeyListener(bc, shc);
ServiceReference sr = mock(ServiceReference.class);
ServiceEvent se = new ServiceEvent(ServiceEvent.MODIFIED_ENDMATCH, sr);
sjl.serviceChanged(se);
verifyZeroInteractions(shc);
}