示例#1
0
 /** @since 3.0 */
 protected String createDefaultServiceName(
     org.osgi.service.remoteserviceadmin.EndpointDescription endpointDescription,
     IDiscoveryAdvertiser advertiser,
     IServiceTypeID serviceTypeID) {
   return RemoteConstants.DISCOVERY_DEFAULT_SERVICE_NAME_PREFIX
       + IDFactory.getDefault().createGUID().getName();
 }
示例#2
0
 private static SSLServerSOContainer createServerContainer(
     String id, SSLServerSOContainerGroup group, String path, int keepAlive)
     throws IDCreateException {
   System.out.println(
       "  Creating container with id="
           + id
           + " keepAlive="
           + keepAlive); //$NON-NLS-1$ //$NON-NLS-2$
   final ID newServerID = IDFactory.getDefault().createStringID(id);
   final SOContainerConfig config = new SOContainerConfig(newServerID);
   return new SSLServerSOContainer(config, group, path, keepAlive);
 }
  protected void createChannel() throws ECFException {
    // Get datashare adapter from new container
    datashareAdapter =
        (IChannelContainerAdapter) container.getAdapter(IChannelContainerAdapter.class);

    // Create channel listener for channel to be created
    IChannelListener channelListener = createChannelListener();
    // Create a channel with given channel listener
    testChannel =
        datashareAdapter.createChannel(
            IDFactory.getDefault().createStringID(Activator.class.getName()),
            channelListener,
            null);
  }
 /*
  * (non-Javadoc)
  *
  * @see org.eclipse.ecf.tests.ContainerAbstractTestCase#setUp()
  */
 protected void setUp() throws Exception {
   super.setUp();
   createServerAndClients();
   connectClients();
   // Add test messaging shared object
   sharedObjectID =
       addClientSharedObject(
           0,
           IDFactory.getDefault().createStringID("foo0"),
           new TestMessagingSharedObject(
               TEST_USERNAME0,
               new IMessageReceiver() {
                 public void handleMessage(ID fromID, Object message) {
                   System.out.println("received fromId=" + fromID + " message=" + message);
                 }
               }),
           null);
   sharedObject =
       (TestMessagingSharedObject) getClientSOManager(0).getSharedObject(sharedObjectID);
   sleep(2000);
 }
 public static R_OSGiID createR_OSGiID(Namespace namespace, String uriStr) {
   return (R_OSGiID) IDFactory.getDefault().createID(namespace, uriStr);
 }
 protected void connectContainer() throws ContainerConnectException {
   // then if targetId is non-null (client), connect to target Id
   if (targetId != null)
     container.connect(
         IDFactory.getDefault().createID(container.getConnectNamespace(), targetId), null);
 }