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


Java DefaultServiceManager类代码示例

本文整理汇总了Java中org.fourthline.cling.model.DefaultServiceManager的典型用法代码示例。如果您正苦于以下问题:Java DefaultServiceManager类的具体用法?Java DefaultServiceManager怎么用?Java DefaultServiceManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: createContentDirectoryService

import org.fourthline.cling.model.DefaultServiceManager; //导入依赖的package包/类
/**
 * Creates an ContentDirectoryService. The content directory includes all
 * Files of the MediaStore.
 * 
 * @return The ContenDiractoryService.
 */
@SuppressWarnings("unchecked")
private LocalService<YaaccContentDirectory> createContentDirectoryService() {
	LocalService<YaaccContentDirectory> contentDirectoryService = new AnnotationLocalServiceBinder().read(YaaccContentDirectory.class);
	contentDirectoryService.setManager(new DefaultServiceManager<YaaccContentDirectory>(contentDirectoryService, null) {

           @Override
           protected int getLockTimeoutMillis() {
               return 1000;
           }

		@Override
		protected YaaccContentDirectory createServiceInstance() throws Exception {
			return new YaaccContentDirectory(getApplicationContext());
		}
	});
	return contentDirectoryService;
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:24,代码来源:YaaccUpnpServerService.java

示例2: createAVTransportService

import org.fourthline.cling.model.DefaultServiceManager; //导入依赖的package包/类
/**
 * creates an AVTransportService
 * 
 * @return the service
 */
@SuppressWarnings("unchecked")
private LocalService<YaaccAVTransportService> createAVTransportService() {
	LocalService<YaaccAVTransportService> avTransportService = new AnnotationLocalServiceBinder().read(YaaccAVTransportService.class);
		avTransportService.setManager(new DefaultServiceManager<YaaccAVTransportService>(avTransportService, null) {
           @Override
           protected int getLockTimeoutMillis() {
               return 1000;
           }

           @Override
		protected YaaccAVTransportService createServiceInstance() throws Exception {
			return new YaaccAVTransportService(getUpnpClient());
		}
	});
	return avTransportService;
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:22,代码来源:YaaccUpnpServerService.java

示例3: createRenderingControl

import org.fourthline.cling.model.DefaultServiceManager; //导入依赖的package包/类
private LocalService<AbstractAudioRenderingControl> createRenderingControl() {
	LocalService<AbstractAudioRenderingControl> renderingControlService = new AnnotationLocalServiceBinder()
			.read(AbstractAudioRenderingControl.class);
	renderingControlService.setManager(new DefaultServiceManager<AbstractAudioRenderingControl>(renderingControlService, null) {
           @Override
           protected int getLockTimeoutMillis() {
               return 1000;
           }

		@Override
		protected AbstractAudioRenderingControl createServiceInstance() throws Exception {
			return new YaaccAudioRenderingControlService(getUpnpClient());
		}
	});
	return renderingControlService;
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:17,代码来源:YaaccUpnpServerService.java

示例4: createMediaReceiverRegistrarService

import org.fourthline.cling.model.DefaultServiceManager; //导入依赖的package包/类
private LocalService<AbstractMediaReceiverRegistrarService> createMediaReceiverRegistrarService() {
	LocalService<AbstractMediaReceiverRegistrarService> service = new AnnotationLocalServiceBinder()
			.read(AbstractMediaReceiverRegistrarService.class);
	service.setManager(new DefaultServiceManager<AbstractMediaReceiverRegistrarService>(service, null) {

           @Override
           protected int getLockTimeoutMillis() {
               return 1000;
           }

		@Override
		protected AbstractMediaReceiverRegistrarService createServiceInstance() throws Exception {
			return new YaaccMediaReceiverRegistrarService(getUpnpClient());
		}
	});
	return service;
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:18,代码来源:YaaccUpnpServerService.java

示例5: createServerConnectionManagerService

import org.fourthline.cling.model.DefaultServiceManager; //导入依赖的package包/类
/**
 * creates a ConnectionManagerService.
 * 
 * @return the service
 */
@SuppressWarnings("unchecked")
private LocalService<ConnectionManagerService> createServerConnectionManagerService() {
	LocalService<ConnectionManagerService> service = new AnnotationLocalServiceBinder().read(ConnectionManagerService.class);
	final ProtocolInfos sourceProtocols = getSourceProtocolInfos();	
	
	service.setManager(new DefaultServiceManager<ConnectionManagerService>(service, ConnectionManagerService.class) {

           @Override
           protected int getLockTimeoutMillis() {
               return 1000;
           }

		@Override
		protected ConnectionManagerService createServiceInstance() throws Exception {
			return new ConnectionManagerService(sourceProtocols, null);
		}
	});

	return service;
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:26,代码来源:YaaccUpnpServerService.java

示例6: createRendererConnectionManagerService

import org.fourthline.cling.model.DefaultServiceManager; //导入依赖的package包/类
/**
 * creates a ConnectionManagerService.
 * 
 * @return the service
 */
@SuppressWarnings("unchecked")
private LocalService<ConnectionManagerService> createRendererConnectionManagerService() {
	LocalService<ConnectionManagerService> service = new AnnotationLocalServiceBinder().read(ConnectionManagerService.class);		
	final ProtocolInfos sinkProtocols = getSinkProtocolInfos();	
	service.setManager(new DefaultServiceManager<ConnectionManagerService>(service, ConnectionManagerService.class) {

           @Override
           protected int getLockTimeoutMillis() {
               return 1000;
           }

		@Override
		protected ConnectionManagerService createServiceInstance() throws Exception {
			return new ConnectionManagerService(null, sinkProtocols);
		}
	});

	return service;
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:25,代码来源:YaaccUpnpServerService.java

示例7: onCreate

import org.fourthline.cling.model.DefaultServiceManager; //导入依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();

    //Create LocalDevice
    LocalService localService = new AnnotationLocalServiceBinder().read(BeyondContentDirectoryService.class);
    localService.setManager(new DefaultServiceManager<>(
            localService, BeyondContentDirectoryService.class));

    String macAddress = Utils.getMACAddress(Utils.WLAN0);
    //Generate UUID by MAC address
    UDN udn = UDN.valueOf(UUID.nameUUIDFromBytes(macAddress.getBytes()).toString());

    try {
        mLocalDevice = new LocalDevice(new DeviceIdentity(udn), new UDADeviceType("MediaServer"),
                new DeviceDetails("Local Media Server"), new LocalService[]{localService});
    } catch (ValidationException e) {
        e.printStackTrace();
    }
    upnpService.getRegistry().addDevice(mLocalDevice);

    //LocalBinder instead of binder
    binder = new LocalBinder();
}
 
开发者ID:kevinshine,项目名称:BeyondUPnP,代码行数:25,代码来源:BeyondUpnpService.java

示例8: createDevice

import org.fourthline.cling.model.DefaultServiceManager; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
public static LocalDevice createDevice() throws ValidationException, LocalServiceBindingException, IOException {
  DeviceIdentity identity = new DeviceIdentity(UDN.uniqueSystemIdentifier("tinyMediaManager"));
  DeviceType type = new UDADeviceType("MediaServer", 1);
  String hostname = NetworkUtil.getMachineHostname();
  if (hostname == null) {
    hostname = Upnp.IP;
  }
  DeviceDetails details = new DeviceDetails("tinyMediaManager (" + hostname + ")",
      new ManufacturerDetails("tinyMediaManager", "http://www.tinymediamanager.org/"),
      new ModelDetails("tinyMediaManager", "tinyMediaManager - Media Server", ReleaseInfo.getVersion()));

  LOGGER.info("Hello, i'm " + identity.getUdn().getIdentifierString());

  // Content Directory Service
  LocalService cds = new AnnotationLocalServiceBinder().read(ContentDirectoryService.class);
  cds.setManager(new DefaultServiceManager<ContentDirectoryService>(cds, ContentDirectoryService.class));

  // Connection Manager Service
  LocalService<ConnectionManagerService> cms = new AnnotationLocalServiceBinder().read(ConnectionManagerService.class);
  cms.setManager(new DefaultServiceManager<>(cms, ConnectionManagerService.class));

  return new LocalDevice(identity, type, details, new LocalService[] { cds, cms });
}
 
开发者ID:tinyMediaManager,项目名称:tinyMediaManager,代码行数:25,代码来源:MediaServer.java

示例9: MediaServer

import org.fourthline.cling.model.DefaultServiceManager; //导入依赖的package包/类
public MediaServer(InetAddress localAddress, Context ctx) throws ValidationException
{
	super(null, port, null, true);

	Log.i(TAG, "Creating media server !");

	localService = new AnnotationLocalServiceBinder()
			.read(ContentDirectoryService.class);

	localService.setManager(new DefaultServiceManager<ContentDirectoryService>(
			localService, ContentDirectoryService.class));

	udn = UDN.valueOf(new UUID(0,10).toString());
	this.localAddress = localAddress;
	this.ctx = ctx;
	createLocalDevice();

	ContentDirectoryService contentDirectoryService = (ContentDirectoryService)localService.getManager().getImplementation();
	contentDirectoryService.setContext(ctx);
	contentDirectoryService.setBaseURL(getAddress());
}
 
开发者ID:trishika,项目名称:DroidUPnP,代码行数:22,代码来源:MediaServer.java

示例10: createContentDirectoryService

import org.fourthline.cling.model.DefaultServiceManager; //导入依赖的package包/类
private LocalService<YaaccContentDirectory> createContentDirectoryService() {
	LocalService<YaaccContentDirectory> contentDirectoryService = new AnnotationLocalServiceBinder()
			.read(YaaccContentDirectory.class);
	contentDirectoryService.setManager(new DefaultServiceManager<YaaccContentDirectory>(
			contentDirectoryService, null) {
		

		@Override
		protected YaaccContentDirectory createServiceInstance()
				throws Exception {
			return new YaaccContentDirectory(context);
		}
	});
	return contentDirectoryService;
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:16,代码来源:LocalUpnpServer.java

示例11: createDevice

import org.fourthline.cling.model.DefaultServiceManager; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
LocalDevice createDevice() throws ValidationException, LocalServiceBindingException, IOException {

    DeviceIdentity identity = new DeviceIdentity(UDN.uniqueSystemIdentifier("SensoryEffectRendererDevice"));
    DeviceType type = new UDADeviceType("SensoryEffectRenderer", 1);
    DeviceDetails details =
            new DeviceDetails(
                    "LPRM - PlaySEM - Sensory Effect Renderer Device",
                    new ManufacturerDetails("LPRM"),
                    new ModelDetails(
                            "PlaySEM.SERendererDevice.ModelA",
                            "A remote Sensory Effect Renderer Device. Model A supports Light, Fan and Vibration.",
                            "v1"
                    )
            );

    String iconResource = "br/ufes/inf/lprm/sensoryeffect/renderer/icon.png";
    Icon icon = new Icon("image/png", 48, 48, 8, "icon.png", Thread.currentThread().getContextClassLoader().getResourceAsStream(iconResource));

    LocalService<SERendererService> seRendererService = new AnnotationLocalServiceBinder().read(SERendererService.class);
    seRendererService.setManager(new DefaultServiceManager(seRendererService, SERendererService.class));

    try {
    	return new LocalDevice(identity, type, details, icon, seRendererService);
    }
    catch (Exception e) {
    	System.out.print("An exception has occured: " + e.getMessage());
    	e.printStackTrace();
    	return null;
    }
}
 
开发者ID:estevaosaleme,项目名称:PlaySEM_SERenderer,代码行数:32,代码来源:SERendererDevice.java

示例12: addServiceToDevice

import org.fourthline.cling.model.DefaultServiceManager; //导入依赖的package包/类
public LocalService<?> addServiceToDevice( Class<?> serviceClass ) {
	LocalService newLocalService = 
			new AnnotationLocalServiceBinder().read(serviceClass);

	newLocalService.setManager(
			new DefaultServiceManager(
					newLocalService, serviceClass
			)
	);
	serviceList.add(newLocalService);
	return newLocalService;
}
 
开发者ID:cyclingengineer,项目名称:UpnpHomeAutomationBridge,代码行数:13,代码来源:UpnpDevice.java

示例13: createDevice

import org.fourthline.cling.model.DefaultServiceManager; //导入依赖的package包/类
public LocalDevice createDevice( ) 
		throws ValidationException,
		LocalServiceBindingException, 
		IOException {

	DeviceIdentity identity = new DeviceIdentity(
			UDN.uniqueSystemIdentifier(deviceIdentity));

	DeviceType type = new UDADeviceType("BinaryLight", 1);

	DeviceDetails details = new DeviceDetails(friendlyName,
			new ManufacturerDetails(manufacturerName), new ModelDetails(
					modelName, modelDescription, modelNumber));

	/*Icon icon = new Icon("image/png", 48, 48, 8, getClass().getResource(
			"icon.png"));*/

	LocalService switchPowerService = new AnnotationLocalServiceBinder()
			.read(implClass);

	switchPowerService.setManager(new DefaultServiceManager(
			switchPowerService, implClass));

	return new LocalDevice(identity, type, details, /*icon,*/
			switchPowerService);

	/*
	 * Several services can be bound to the same device: return new
	 * LocalDevice( identity, type, details, icon, new LocalService[]
	 * {switchPowerService, myOtherService} );
	 */

}
 
开发者ID:cyclingengineer,项目名称:UpnpHomeAutomationBridge,代码行数:34,代码来源:BinaryLightDevice.java

示例14: MediaServer

import org.fourthline.cling.model.DefaultServiceManager; //导入依赖的package包/类
public MediaServer(Context context ) throws ValidationException {
    mContext = context;
    DeviceType type = new UDADeviceType(deviceType, version);

    DeviceDetails details = new DeviceDetails(SettingActivity.getDeviceName(context) + " ("
            + android.os.Build.MODEL + ")", new ManufacturerDetails(
            android.os.Build.MANUFACTURER), new ModelDetails(android.os.Build.MODEL,
            Utils.DMS_DESC, "v1"));

    LocalService service = new AnnotationLocalServiceBinder()
            .read(ContentDirectoryService.class);

    service.setManager(new DefaultServiceManager<ContentDirectoryService>(service,
            ContentDirectoryService.class));

    udn = UpnpUtil.uniqueSystemIdentifier("msidms");

    localDevice = new LocalDevice(new DeviceIdentity(udn), type, details, createDefaultDeviceIcon(), service);

    Log.v(LOGTAG, "MediaServer device created: ");
    Log.v(LOGTAG, "friendly name: " + details.getFriendlyName());
    Log.v(LOGTAG, "manufacturer: " + details.getManufacturerDetails().getManufacturer());
    Log.v(LOGTAG, "model: " + details.getModelDetails().getModelName());

    // start http server
    try {
        new HttpServer(PORT);
    } catch (IOException ioe) {
        System.err.println("Couldn't start server:\n" + ioe);
        System.exit(-1);
    }

    Log.v(LOGTAG, "Started Http Server on port " + PORT);
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:35,代码来源:MediaServer.java

示例15: createMediaServerDevice

import org.fourthline.cling.model.DefaultServiceManager; //导入依赖的package包/类
private LocalDevice createMediaServerDevice() throws Exception {

        String serverName = settingsService.getDlnaServerName();
        DeviceIdentity identity = new DeviceIdentity(UDN.uniqueSystemIdentifier(serverName));
        DeviceType type = new UDADeviceType("MediaServer", 1);

        // TODO: DLNACaps

        DeviceDetails details = new DeviceDetails(serverName, new ManufacturerDetails(serverName),
                new ModelDetails(serverName),
                new DLNADoc[]{new DLNADoc("DMS", DLNADoc.Version.V1_5)}, null);

        Icon icon = new Icon("image/png", 512, 512, 32, "logo-512", getClass().getResourceAsStream("logo-512.png"));

        LocalService<CustomContentDirectory> contentDirectoryservice = new AnnotationLocalServiceBinder().read(CustomContentDirectory.class);
        contentDirectoryservice.setManager(new DefaultServiceManager<CustomContentDirectory>(contentDirectoryservice) {

            @Override
            protected CustomContentDirectory createServiceInstance() throws Exception {
                return dispatchingContentDirectory;
            }
        });

        final ProtocolInfos protocols = new ProtocolInfos();
        for (DLNAProfiles dlnaProfile : DLNAProfiles.values()) {
            if (dlnaProfile == DLNAProfiles.NONE) {
                continue;
            }
            try {
                protocols.add(new DLNAProtocolInfo(dlnaProfile));
            } catch (Exception e) {
                // Silently ignored.
            }
        }

        LocalService<ConnectionManagerService> connetionManagerService = new AnnotationLocalServiceBinder().read(ConnectionManagerService.class);
        connetionManagerService.setManager(new DefaultServiceManager<ConnectionManagerService>(connetionManagerService) {
            @Override
            protected ConnectionManagerService createServiceInstance() throws Exception {
                return new ConnectionManagerService(protocols, null);
            }
        });

        // For compatibility with Microsoft
        LocalService<MSMediaReceiverRegistrarService> receiverService = new AnnotationLocalServiceBinder().read(MSMediaReceiverRegistrarService.class);
        receiverService.setManager(new DefaultServiceManager<>(receiverService, MSMediaReceiverRegistrarService.class));

        return new LocalDevice(identity, type, details, new Icon[]{icon}, new LocalService[]{contentDirectoryservice, connetionManagerService, receiverService});
    }
 
开发者ID:airsonic,项目名称:airsonic,代码行数:50,代码来源:UPnPService.java


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