本文整理匯總了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);
}