Package com.sun.sgs.app

Examples of com.sun.sgs.app.Channel


       
        // We were passed a reference to the first channel.
        channel1.get().join(session);
       
        // We look up the second channel by name.
        Channel channel2 = channelMgr.getChannel(HelloChannels.CHANNEL_2_NAME);
        channel2.join(session);
    }
View Full Code Here


     */
    public void initialize(Properties props) {
        ChannelManager channelMgr = AppContext.getChannelManager();
       
        // Create and keep a reference to the first channel.
        Channel c1 = channelMgr.createChannel(CHANNEL_1_NAME,
                                              null,
                                              Delivery.RELIABLE);
        channel1 = AppContext.getDataManager().createReference(c1);
       
        // We don't keep a reference to the second channel, to demonstrate
View Full Code Here

     */
    protected void openChannel() {
        CellMO cell = cellRef.get();

        ChannelManager cm = AppContext.getChannelManager();
        Channel cellChannel = cm.createChannel("Cell "+cell.getCellID().toString(),
                                               null,
                                               Delivery.RELIABLE);

        DataManager dm = AppContext.getDataManager();
        cellChannelRef = dm.createReference(cellChannel);
View Full Code Here

    /**
     * Close the channel for this component.
     */
    protected void closeChannel() {
        DataManager dm = AppContext.getDataManager();
        Channel channel = cellChannelRef.get();
        dm.removeObject(channel);

        cellSender=null;
        cellChannelRef = null;
    }
View Full Code Here

            ChannelManager cm = AppContext.getChannelManager();
           
            ClientSessionSet sessions = new ClientSessionSet();
            String channelName = handler.getConnectionType().toString() +
                                 "(" + String.valueOf(assignID) + ")";
            Channel channel = cm.createChannel(channelName,
                                               null,
                                               Delivery.RELIABLE);

            // mark ourself for udate
            dm.markForUpdate(this);
View Full Code Here

         ChannelListener listener,
         Delivery delivery)
    {
        serviceStats.createChannelOp.report();
  try {
      Channel channel = ChannelImpl.newInstance(
    name, listener, delivery, writeBufferSize);
      return channel;
     
  } catch (RuntimeException e) {
      logger.logThrow(Level.FINEST, e, "createChannel:{0} throws");
View Full Code Here

       
        // We were passed a reference to the first channel.
        channel1.get().join(session);
       
        // We look up the second channel by name.
        Channel channel2 = channelMgr.getChannel(HelloChannels.CHANNEL_2_NAME);
        channel2.join(session);
    }
View Full Code Here

     */
    public void initialize(Properties props) {
        ChannelManager channelMgr = AppContext.getChannelManager();
       
        // Create and keep a reference to the first channel.
        Channel c1 = channelMgr.createChannel(CHANNEL_1_NAME,
                                              null,
                                              Delivery.RELIABLE);
        channel1 = AppContext.getDataManager().createReference(c1);
       
        // We don't keep a reference to the second channel, to demonstrate
View Full Code Here

      if (action.equals("join")) {
    String channelName = buf.getString();
    System.err.println("DummyClientSessionListener: join request, " +
           "channel name: " + channelName +
           ", user: " + name);
    Channel channel =
        (Channel) dataManager.getBinding(channelName);
    channel.join(session);
    session.send(message.asReadOnlyBuffer());
      } else if (action.equals("leave")) {
    String channelName = buf.getString();
    System.err.println("DummyClientSessionListener: leave request, " +
           "channel name: " + channelName +
           ", user: " + name);
    Channel channel =
        (Channel) dataManager.getBinding(channelName);
    channel.leave(session);
    session.send(message.asReadOnlyBuffer());
      } else {
    System.err.println("DummyClientSessionListener: UNKNOWN request, " +
           "action: " +  action +
           ", user: " + name);
View Full Code Here

    public void testChannelSendAllClosedChannel() throws Exception {
  final String channelName = "test";
  createChannel(channelName);
  txnScheduler.runTask(new TestAbstractKernelRunnable() {
      public void run() {
    Channel channel = getChannel(channelName);
    dataService.removeObject(channel);
    try {
        channel.send(null, ByteBuffer.wrap(testMessage));
        fail("Expected IllegalStateException");
    } catch (IllegalStateException e) {
        System.err.println(e);
    }
      }
View Full Code Here

TOP

Related Classes of com.sun.sgs.app.Channel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.