Package org.omg.dds

Examples of org.omg.dds.DataReader


        Object instance = null  ;
        boolean is_topic= false ;
        boolean is_instance = false ;
        Subscriber sub_temp ;
        SubscriberImpl sub_impl_temp ;
        DataReader DR ;
        Class typehelper = null ;
        Class  type_param_extract [] = new Class [1 ];
        java.lang.Object valu_param_extract[] = new java.lang.Object[1];
        Iterator It ;
       
        if(data.type().equal(TopicHelper.type()))
        {                       
            is_topic = true ;
            topic = TopicHelper.extract(data) ;          
        }
        else
        {           
            is_instance = true ;
            valu_param_extract[0] = data ;
            type_param_extract[0] = Any.class ;
           
            try{
                typehelper  = Class.forName(topic.get_type_name()+"Helper") ;
                Method extract = typehelper.getMethod("extract",type_param_extract);
                instance = extract.invoke(null ,valu_param_extract);
            }
            catch(Exception e)
            {
                e.printStackTrace();
            }         
        }
       
        if(is_topic){           
            Lookup_Sub_interesded_of_topic(topic.get_name());          
        }
        else if( is_instance)
        {          
            try{               
                It = all_Sub.iterator() ;
                while(It.hasNext()){
                    sub_temp = (Subscriber)It.next() ;
                    sub_impl_temp = (SubscriberImpl)poa.reference_to_servant(sub_temp);
                    sub_impl_temp.setInstance(instance);                   
                    DR = sub_temp.lookup_datareader(topic.get_name());                   
                    DR.take_instance_from_subscriber() ;
                   
                    if(DR.get_listener()!= null ){                       
                        DR.get_listener().on_data_available(DR);                       
                    }                                                          
                }
                all_Sub.removeAllElements();                               
            }
            catch (Exception e){
View Full Code Here


   * @param a_listener
   * @return
   */
  public DataReader create_datareader(TopicDescription a_topic,
      DataReaderQos qos, DataReaderListener a_listener) {
    DataReader DR = null ;
    Servant impl;
   
    try{
     
      Class type = Class.forName(a_topic.get_type_name()+"DataReaderImpl") ;
View Full Code Here

   * @param topic_name
   * @return
   */
  public DataReader lookup_datareader(String topic_name) {   
    Iterator It = Vector_DataReaders.iterator();
    DataReader  temp ;
   
    while(It.hasNext()){
      temp = (DataReader)It.next() ;
      if(temp.get_topicdescription().get_name().equals(topic_name)) {
        return temp ;
      }
    }   
   
    return null ;
View Full Code Here

   * @param
   * @return
   */
  public void notify_datareaders() {
    Iterator It = Vector_DataReaders.iterator();
    DataReader  temp ;
   
    while(It.hasNext()){
      temp = (DataReader)It.next() ;
      temp.get_listener().on_data_available(temp);
    }
  }
View Full Code Here

            poa.the_POAManager().activate();
            DomainParticipantFactory domainparticipantFactory ;
            DomainParticipant domainparticipant ;
            Subscriber suscriber ;
            FooDataReader foodatareader ;
            DataReader datareader ;
            org.omg.dds.Topic  topic ;
            SubscriberQos suscriberqos ;
            DataReaderQos datareaderqos ;     
            org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
            // Use NamingContextExt which is part of the Interoperable
View Full Code Here

            poa.the_POAManager().activate();
            DomainParticipantFactory domainparticipantFactory;
            DomainParticipant domainparticipant;
            Subscriber suscriber;
            TemperatureDataReader temperdatareader;
            DataReader datareader;
            org.omg.dds.Topic topic;
            SubscriberQos suscriberqos;
            DataReaderQos datareaderqos;
            org.omg.CORBA.Object objRef = orb
                    .resolve_initial_references("NameService");
View Full Code Here

            Publisher publisher;
            DataWriter datawriter;
            PublisherQos publisherqos;
            DataWriterQos datawriterqos;
            Subscriber suscriber;
            DataReader datareader;
            org.omg.dds.Topic topicMessage;
            SubscriberQos suscriberqos;
            DataReaderQos datareaderqos;

            org.omg.CORBA.Object objRef = orb
View Full Code Here

        Object instance = null  ;
        boolean is_topic= false ;
        boolean is_instance = false ;
        Subscriber sub_temp ;
        SubscriberImpl sub_impl_temp ;
        DataReader DR ;
        Class typehelper = null ;
        Class  type_param_extract [] = new Class [1 ];
        java.lang.Object valu_param_extract[] = new java.lang.Object[1];
        Iterator It ;
       
        if(data.type().equal(TopicHelper.type()))
        {                       
            is_topic = true ;
            topic = TopicHelper.extract(data) ;          
        }
        else
        {           
            is_instance = true ;
            valu_param_extract[0] = data ;
            type_param_extract[0] = Any.class ;
           
            try{
                typehelper  = Class.forName(topic.get_type_name()+"Helper") ;
                Method extract = typehelper.getMethod("extract",type_param_extract);
                instance = extract.invoke(null ,valu_param_extract);
            }
            catch(Exception e)
            {
                e.printStackTrace();
            }         
        }
       
        if(is_topic){           
            Lookup_Sub_interesded_of_topic(topic.get_name());          
        }
        else if( is_instance)
        {          
            try{               
                It = all_Sub.iterator() ;
                while(It.hasNext()){
                    sub_temp = (Subscriber)It.next() ;
                    sub_impl_temp = (SubscriberImpl)poa.reference_to_servant(sub_temp);
                    sub_impl_temp.setInstance(instance);                   
                    DR = sub_temp.lookup_datareader(topic.get_name());                   
                    DR.take_instance_from_subscriber() ;
                   
                    if(DR.get_listener()!= null ){                       
                        DR.get_listener().on_data_available(DR);                       
                    }                                                          
                }
                all_Sub.removeAllElements();                               
            }
            catch (Exception e){
View Full Code Here

   * @param a_listener
   * @return
   */
  public DataReader create_datareader(TopicDescription a_topic,
      DataReaderQos qos, DataReaderListener a_listener) {
    DataReader DR = null ;
    Servant impl;
   
    try{
     
      Class type = Class.forName(a_topic.get_type_name()+"DataReaderImpl") ;
View Full Code Here

   * @param topic_name
   * @return
   */
  public DataReader lookup_datareader(String topic_name) {   
    Iterator It = Vector_DataReaders.iterator();
    DataReader  temp ;
   
    while(It.hasNext()){
      temp = (DataReader)It.next() ;
      if(temp.get_topicdescription().get_name().equals(topic_name)) {
        return temp ;
      }
    }   
   
    return null ;
View Full Code Here

TOP

Related Classes of org.omg.dds.DataReader

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.