connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/registry/Registry.java
changeset 666 4817219999f0
parent 382 6a8fd4465a9b
child 687 593d05f9d5ca
equal deleted inserted replaced
665:12ea338ad1f6 666:4817219999f0
   129 				return false;
   129 				return false;
   130 		}
   130 		}
   131 		return true;
   131 		return true;
   132 	}
   132 	}
   133 	
   133 	
       
   134 	@SuppressWarnings("unchecked")
   134 	private <T> void loadExtensions(String extensionId, String loadError, Collection<T> extensionObjects, IFilter filter) {
   135 	private <T> void loadExtensions(String extensionId, String loadError, Collection<T> extensionObjects, IFilter filter) {
   135 		IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
   136 		IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
   136 		IExtensionPoint extensionPoint = extensionRegistry.getExtensionPoint(extensionId);
   137 		IExtensionPoint extensionPoint = extensionRegistry.getExtensionPoint(extensionId);
   137 		IExtension[] extensions = extensionPoint.getExtensions();
   138 		IExtension[] extensions = extensionPoint.getExtensions();
   138 		
   139 		
   233 
   234 
   234 	private List<IConnectedService> createConnectedServicesForConnection(IConnection connection) {
   235 	private List<IConnectedService> createConnectedServicesForConnection(IConnection connection) {
   235 		List<IConnectedService> connectedServices = new ArrayList<IConnectedService>();
   236 		List<IConnectedService> connectedServices = new ArrayList<IConnectedService>();
   236 		for (IService service : getCompatibleServices(connection.getConnectionType())) {
   237 		for (IService service : getCompatibleServices(connection.getConnectionType())) {
   237 			IConnectedService connectedService = createConnectedService(service, connection);
   238 			IConnectedService connectedService = createConnectedService(service, connection);
   238 			connectedServices.add(connectedService);
   239 			if (connectedService != null)
       
   240 				connectedServices.add(connectedService);
   239 		}
   241 		}
   240 		return connectedServices;
   242 		return connectedServices;
   241 	}
   243 	}
   242 	
   244 	
   243 	public IConnectedService createConnectedService(IService service, IConnection connection) {
   245 	public IConnectedService createConnectedService(IService service, IConnection connection) {
   303 	public Collection<IService> getCompatibleServices(IConnectionType connectionType) {
   305 	public Collection<IService> getCompatibleServices(IConnectionType connectionType) {
   304 		Check.checkContract(connectionTypeToServices != null);
   306 		Check.checkContract(connectionTypeToServices != null);
   305 		Collection<IService> services = connectionTypeToServices.get(connectionType);
   307 		Collection<IService> services = connectionTypeToServices.get(connectionType);
   306 		if (services != null)
   308 		if (services != null)
   307 			return new ArrayList<IService>(services);
   309 			return new ArrayList<IService>(services);
   308 		return Collections.EMPTY_LIST;
   310 		return Collections.emptyList();
   309 	}
   311 	}
   310 	
   312 	
   311 	/* (non-Javadoc)
   313 	/* (non-Javadoc)
   312 	 * @see com.nokia.carbide.remoteconnections.registry.IConnectionStore#addConnection(com.nokia.carbide.remoteconnections.extensions.IConnection)
   314 	 * @see com.nokia.carbide.remoteconnections.registry.IConnectionStore#addConnection(com.nokia.carbide.remoteconnections.extensions.IConnection)
   313 	 */
   315 	 */