Examples of Channel


Examples of net.gleamynode.netty.channel.Channel

        ChannelHandler parentHandler = getParentHandler();
        if (parentHandler != null) {
            bossPipeline.addLast("userHandler", parentHandler);
        }

        Channel channel = getFactory().newChannel(bossPipeline);

        // Wait until the future is available.
        ChannelFuture future = null;
        do {
            try {
View Full Code Here

Examples of net.hkionline.rss.Channel

 
 
  /* This method performs the actual feed parsing and returns a nice Channel-object for easy feed handling. */
  public Channel read(){
   
    Channel feed = null;
   
    try{
      // Items and the channel have XML elements using the same name.
      boolean isFeedHeader = true;
     
      String title = null;
      String link = null;
      String description = null;
      String author = null;
      String enclosure = null;
      String guid = null;
      String language = null;
      String copyright = null;
      String managingEditor = null;
      String webmaster = null;
      String pubDate = null;
      String source = null;
      String lastBuildDate = null;
      String category = null;
      String generator = null;
      String ttl = null;
      String image = null;
     
      // Lets create the factories and reader objects first to handle the XML stream
     
      InputStream inputStream = null;
      try {
        inputStream = uri.openStream();
      }
      catch (IOException e) {
        throw new RuntimeException(e);
      }

      XMLInputFactory inputFactory = XMLInputFactory.newInstance();
      XMLEventReader eventReader = inputFactory.createXMLEventReader(inputStream);
     
      // StAX is event based, so lets loop trough the events and while there is next
       while (eventReader.hasNext()) {
         XMLEvent event = eventReader.nextEvent();
        
         if (event.isStartElement()) {
                String localPart = event.asStartElement().getName().getLocalPart();
               
                switch (localPart) {
                case _item:
                  if (isFeedHeader) {
                    // This is done once to instantiate a channel object and save the channels/feed header/metadata
                    // This takes place right after the parser has hit the first start tag of an item-element in the RSS-feed
                    isFeedHeader = false;
                    feed = new Channel(title, link, description, language, copyright,  managingEditor,  webmaster,  pubDate, lastBuildDate, category, generator, ttl, image);
                  }
                  event = eventReader.nextEvent();
                  break;
                case _title:
                  title = getElementData(event, eventReader);
                  break;
                case _link:
                  link = getElementData(event, eventReader);
                  break;               
                case _description:
                  description = getElementData(event, eventReader);
                  break;
                case _author:
                  author = getElementData(event, eventReader);
                  break;
                case _enclosure:
                  enclosure = getElementData(event, eventReader);
                  break;
                case _guid:
                  guid = getElementData(event, eventReader);
                  break;
                case _language:
                  language = getElementData(event, eventReader);
                  break;
                case _copyright:
                  copyright = getElementData(event, eventReader);
                  break;
                case _managingEditor:
                  managingEditor = getElementData(event, eventReader);
                  break;
                case _webmaster:
                  webmaster = getElementData(event, eventReader);
                  break;
                case _pubDate:
                  pubDate = getElementData(event, eventReader);
                  break;
                case _source:
                  source = getElementData(event, eventReader);
                  break;
                case _lastBuildDate:
                  lastBuildDate = getElementData(event, eventReader);
                  break;
                case _category:
                  category = getElementData(event, eventReader);
                  break;
                case _generator:
                  generator = getElementData(event, eventReader);
                  break;
                case _ttl:
                  ttl = getElementData(event, eventReader);
                  break;
                case _image:
                  image = getElementData(event, eventReader);
                  break;
                }
         }
         else if (event.isEndElement()) {
           /*
            * This event happens when the parser hits the closing tag of an RSS-feed element.
            * We are interested at item-tags. When they close we want to save the information of the child elements to a new item-object and to the feed itself
            */
           if (event.asEndElement().getName().getLocalPart() == (_item)) {

             Item item = new Item();
            
            
             item.setTitle(title);
             item.setDescription(description);
             item.setLink(link);
             item.setAuthor(author);
             item.setCategory(category);
             item.setEnclosure(enclosure);
             item.setGuid(guid);
             item.setPubDate(pubDate);
             item.setSource(source);
                         
             feed.getItems().add(item);
            
             // We have now saved a new item  to our feed model so we can continue to the next item
             event = eventReader.nextEvent();
             continue;
                }
View Full Code Here

Examples of net.minecraft.util.io.netty.channel.Channel

        };
   
        serverChannelHandler = new ChannelInboundHandlerAdapter() {
          @Override
          public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
                Channel channel = (Channel) msg;

                // Prepare to initialize ths channel
                channel.pipeline().addFirst(beginInitProtocol);
                ctx.fireChannelRead(msg);
          }
        };
  }
View Full Code Here

Examples of net.schmizz.sshj.connection.channel.Channel

    private Channel getChannel(SSHPacket buffer)
            throws ConnectionException {
        try {
            final int recipient = buffer.readUInt32AsInt();
            final Channel channel = get(recipient);
            if (channel != null)
                return channel;
            else {
                buffer.rpos(buffer.rpos() - 5);
                throw new ConnectionException(DisconnectReason.PROTOCOL_ERROR,
View Full Code Here

Examples of net.wicast.Channel

    System.out.println( configElement.toString() ) ;   
    NodeList nodeList = configElement.getElementsByTagName( "net.wicast.server.channel" ) ;
    if (nodeList != null) {
      for (int i = 0; i < nodeList.getLength() ; i++) {
        Element element = (Element) nodeList.item(i) ;
        channel = new Channel( element ) ;
      }
    }
  }
View Full Code Here

Examples of nexj.core.meta.integration.Channel

    * export.
    */
   public void testInterfaceToWSDLWithSeveralNamespaces() throws Exception
   {
      Interface iface = m_metadata.getInterface("WSDLExportTest1");
      Channel channel = m_metadata.getChannel("WSDLExportTestChannel1");

      m_exporter.setOutputMode(XSDMessageExporter.OUTMODE_WSDL);
      m_exporter.export(iface, channel, m_resultWriter);

      assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
View Full Code Here

Examples of ome.xml.model.Channel

      final WellSample sample = well.getWellSample(d.site);
      Image image = new Image();
      Pixels pixels = new Pixels();
      Channel [] channels = new Channel[d.sizeC];
      for (int i=0; i<d.sizeC; i++) {
        Channel c = new Channel();
        c.setName(MockImageDescription.DEFAULT_CHANNEL_NAMES[i]);
        pixels.addChannel(c);
        channels[i] = c;
      }
      pixels.setSizeX(new PositiveInteger(d.sizeX));
      pixels.setSizeY(new PositiveInteger(d.sizeY));
View Full Code Here

Examples of org.activeio.Channel

        SocketMetadata socket = (SocketMetadata) clientChannel.narrow(SocketMetadata.class);
        if( socket != null )
            socket.setTcpNoDelay(true);
        log.info("Get connection that was accepted on the server side.");
       
        Channel c = server.accept(1000*5);
  assertNotNull(c);
        
        serverChannel = AsynchToSynchChannelAdapter.adapt(c);
        serverChannel.start();
        socket = (SocketMetadata) serverChannel.narrow(SocketMetadata.class);               
View Full Code Here

Examples of org.apache.camel.Channel

            boolean endpointInterceptor = false;

            // are we routing to an endpoint interceptor, if so we should not add it as an event driven
            // processor as we use the producer to trigger the interceptor
            if (processor instanceof Channel) {
                Channel channel = (Channel) processor;
                Processor next = channel.getNextProcessor();
                if (next instanceof InterceptEndpointProcessor) {
                    endpointInterceptor = true;
                }
            }
View Full Code Here

Examples of org.apache.catalina.tribes.Channel

    }

    public void stop() {
        if (map != null) {
            map.removeListener(this);
            Channel channel = map.getChannel();
            map.breakdown();
            try {
                channel.stop(Channel.DEFAULT);
            } catch (ChannelException e) {
                logger.log(Level.WARNING, e.getMessage(), e);
            }
            map = null;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.