/** * Register the current connection as an OSGi service */ private EntryImpl registerConnection ( final ConnectionDescriptor connectionDescriptor, final ConnectionService connectionService ) { final Class<?>[] interfaces = connectionService.getSupportedInterfaces (); final String[] clazzes = new String[interfaces.length]; int i = 0; for ( final Class<?> iface : interfaces ) { clazzes[i] = iface.getName (); i++; } final Dictionary<String, String> properties = new Hashtable<String, String> (); properties.put ( ConnectionService.CONNECTION_URI, connectionDescriptor.getConnectionInformation ().toString () ); if ( connectionDescriptor.getServiceId () != null ) { properties.put ( Constants.SERVICE_PID, connectionDescriptor.getServiceId () ); } final ServiceRegistration<?> serviceRegistration = this.context.registerService ( clazzes, connectionService, properties ); return new EntryImpl ( connectionDescriptor, connectionService, serviceRegistration ); }
/** * Register the current connection as an OSGi service */ private EntryImpl registerConnection ( final ConnectionDescriptor connectionDescriptor, final ConnectionService connectionService ) { final Class<?>[] interfaces = connectionService.getSupportedInterfaces (); final String[] clazzes = new String[interfaces.length]; int i = 0; for ( final Class<?> iface : interfaces ) { clazzes[i] = iface.getName (); i++; } final Dictionary<String, String> properties = new Hashtable<String, String> (); properties.put ( ConnectionService.CONNECTION_URI, connectionDescriptor.getConnectionInformation ().toString () ); if ( connectionDescriptor.getServiceId () != null ) { properties.put ( Constants.SERVICE_PID, connectionDescriptor.getServiceId () ); } final ServiceRegistration<?> serviceRegistration = this.context.registerService ( clazzes, connectionService, properties ); return new EntryImpl ( connectionDescriptor, connectionService, serviceRegistration ); }
final Class<?>[] clazzes = this.connectionService.getSupportedInterfaces (); final String[] str = new String[clazzes.length]; for ( int i = 0; i < clazzes.length; i++ )
return String.format ( Messages.PropertySourceWrapper_StateFormat, StringHelper.join ( service.getSupportedInterfaces (), Messages.PropertySourceWrapper_StateFormatDelim ) );
return String.format ( Messages.PropertySourceWrapper_StateFormat, StringHelper.join ( service.getSupportedInterfaces (), Messages.PropertySourceWrapper_StateFormatDelim ) );