Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
  *  DDS (Data Distribution Service) for JacORB
  *
  * Copyright (C) 2005-2012 Gerald Brose / The JacORB Team.
  * allaoui <fouad.allaoui@gmail.com>, Didier Donsez (didier.donsez@ieee.org)
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public License
  * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 *
 * Coontact: Ahmed yehdih <ahmed.yehdih@gmail.com>, fouad allaoui
 * <fouad.allaoui@gmail.com>, Didier Donsez (didier.donsez@ieee.org)
 * Contributor(s)
 *
 **/
 package org.jacorb.dds;
The DomainParticipant object plays several roles: - It acts as a container for all other Entity objects - It acts as factory for the Publisher, Subscriber, Topic and MultiTopic Entity objects. - It represents the participation of the application on a communication plane that isolates applications running on the same set of physical computers from each other. A domain establishes a 'virtual network' linking all applications that share the same domainId9 and isolating them from applications running on different domains. In this way, several independent distributed applications can coexist in the same physical network without interfering, or even being aware of each other. - It provides administration services in the domain, offering operations that allow the application to 'ignore' locally any information about a given participant
 
 public class DomainParticipantImpl extends DomainParticipantPOA {
 
     private org.omg.CORBA.ORB orb ;
     private org.omg.PortableServer.POA poa ;
     private int domainId ;
     private org.omg.dds.DomainParticipantQos qos;
     private Vector Vector_Publisher ;
     private Vector Vector_Subscriber ;
     private Vector Vector_Topic ;


    

Parameters:
domainId
qos
a_listener
 
     public DomainParticipantImpl(int domainId , org.omg.dds.DomainParticipantQos qos , org.omg.dds.DomainParticipantListener a_listener){
 
         this. = domainId ;
         this. = qos ;
         this. = a_listener ;
          = new Vector() ;
          = new Vector();
          = new Vector();
     }

    

Parameters:
Pub
 
     public void addPublisher(Publisher Pub){
         .add(Pub);
    }

    

Parameters:
Pub
    public void deletePublisher(Publisher Pub){
         .remove(Pub);
    }

    

Parameters:
Sub
    public void addsubscriber(Subscriber Sub){
        .add(Sub);
    }

    

Parameters:
Sub
    public void deleteSubscriber(Subscriber Sub){
         .remove(Sub);
    }

    

Parameters:
Top
    public void addTopic(Topic Top){
        .add(Top);
    }

    

Parameters:
Top
    public void deleteTopic(Topic Top){
         .removeTop);
    }

    
Sets the pOA attribute of the RepertoryImpl object

Parameters:
poa The new pOA value
    public void setPOA(org.omg.PortableServer.POA poa) {
        this. = poa;
    }

    
Sets the oRB attribute of the RepertoryImpl object

Parameters:
orb The new oRB value
    public void setORB(org.omg.CORBA.ORB orb) {
        this. = orb;
    }

    

Parameters:
qos
a_listener
Returns:
    public Publisher create_publisher(PublisherQos qos,PublisherListener a_listener) {
        org.omg.dds.Publisher ref = null  ;
        PublisherImpl implnew PublisherImpl(  qos,  a_listener  , _this() );
        impl.setORB();
        impl.setPOA();
        try{
            org.omg.CORBA.Object oref = .servant_to_reference(impl);
            ref = org.omg.dds.PublisherHelper.narrow(oref);
            addPublisher(ref);
        }
        catch(Exception e){
        }
        return ref ;
    }

    

Parameters:
p
Returns:
    public int delete_publisher(Publisher p) {
        try{
            boolean delete_ok = ((PublisherImpl.reference_to_servant(p)).isDeletable();
            if(delete_ok ){
                deletePublisher(p);
            }
            else {
                return . ;
            }
        }
        catch(Exception e){
        }
         return . ;
    }

    

Parameters:
qos
a_listener
Returns:
            SubscriberListener a_listener) {
        org.omg.dds.Subscriber ref = null  ;
        org.jacorb.dds.SubscriberImpl implnew org.jacorb.dds.SubscriberImpl(  qos,  a_listener , _this());
        impl.setORB();
        impl.setPOA();
        try{
            org.omg.CORBA.Object oref = .servant_to_reference(impl);
            ref = org.omg.dds.SubscriberHelper.narrow(oref);
            addsubscriber(ref);
        }
        catch(Exception e){
        }
        return ref ;
    }

    

Parameters:
s
Returns:
    public int delete_subscriber(Subscriber s) {
        try{
            boolean delete_ok = ((SubscriberImpl.reference_to_servant(s)).isDeletable();
            if(delete_ok ){
                deleteSubscriber(s);
            }
            else {
                return . ;
            }
        }
        catch(Exception e){
        }
         return . ;
    }

    
Not Implemented

Returns:
        return null;
    }

    

Parameters:
topic_name
type_name
qos
a_listener
Returns:
    public Topic create_topic(String topic_nameString type_name,
            TopicQos qosTopicListener a_listener) {
        org.omg.dds.Topic ref = null  ;
        org.jacorb.dds.TopicImpl implnew org.jacorb.dds.TopicImpltopic_name,type_nameqos,  a_listener,_this());
        impl.setORB();
        impl.setPOA();
        try{
            ref = (Topic)lookup_topicdescription(topic_name);
            //not exist another topic has same name
            if(ref == null){
                org.omg.CORBA.Object oref = .servant_to_reference(impl);
                ref = org.omg.dds.TopicHelper.narrow(oref);
                addTopic(ref);
            }
            else {
                if(!(ref.get_type_name().equals(type_name))){
                    ref = null  ;
                }
            }
        }
        catch(Exception e){
        }
        return ref ;
    }

    

Parameters:
a_topic
Returns:
    public int delete_topic(Topic a_topic) {
        Iterator It = .iterator() ;
        Subscriber temp ;
        while(It.hasNext()){
            temp = (Subscriber)It.next() ;
            if (temp.lookup_datareader(a_topic.get_name())!= null){
                return . ;
            }
        }
        It = .iterator() ;
        Publisher pub ;
        while(It.hasNext()){
            pub = (Publisher)It.next() ;
            if (pub.lookup_datawriter(a_topic.get_name())!= null){
                return . ;
            }
        }
        delete_topic(a_topic );
        return . ;
    }
    public Topic find_topic(String topic_nameDuration_t timeout) {
        return null;
    }

    

Parameters:
name
Returns:
        TopicDescription topic  = null ,temp;
        Iterator Iter = .iterator();
        while(Iter.hasNext()){
            temp = (TopicDescription)Iter.next();
            if(temp.get_name().equals(name)) topic = temp ;
        }
        return topic;
    }

    
Not Implemented

Returns:
            Topic related_topicString filter_expression,
            String[] filter_parameters) {
        return null;
    }

    
Not Implemented

Returns:
    public int delete_contentfilteredtopic(
            ContentFilteredTopic a_contentfilteredtopic) {
        return 0;
    }

    
Not Implemented

Returns:
    public MultiTopic create_multitopic(String nameString type_name,
            String subscription_expressionString[] expression_parameters) {
        return null;
    }

    
Not Implemented

Returns:
    public int delete_multitopic(MultiTopic a_multitopic) {
        return 0;
    }

    
Not Implemented

Returns:
    public int delete_contained_entities() {
        return 0;
    }

    

Parameters:
qos
Returns:
    public int set_qos(DomainParticipantQos qos) {
        this. = qos ;
        return 0;
    }

    

Parameters:
qos
    public void get_qos(DomainParticipantQosHolder qos) {
        qos.value = this. ;
    }

    

Parameters:
a_listener
mask
Returns:
    public int set_listener(DomainParticipantListener a_listenerint mask) {
        // TODO Auto-generated method stub
        return 0;
    }

    
Not Implemented

Returns:
        return null;
    }

    
Not Implemented

Returns:
    public int ignore_participant(int handle) {
        return 0;
    }

    
Not Implemented

Returns:
    public int ignore_topic(int handle) {
        return 0;
    }

    
Not Implemented

Returns:
    public int ignore_publication(int handle) {
        return 0;
    }

    
Not Implemented

Returns:
    public int ignore_subscription(int handle) {
        return 0;
    }

    
Not Implemented

Returns:
    public int get_domain_id() {
        return this. ;
    }

    
Not Implemented

Returns:
    public void assert_liveliness() {
    }

    
Not Implemented

Returns:
    public int set_default_publisher_qos(PublisherQos qos) {
        return 0;
    }

    
Not Implemented

Returns:
    public void get_default_publisher_qos(PublisherQosHolder qos) {
    }

    
Not Implemented

Returns:
    public int set_default_subscriber_qos(SubscriberQos qos) {
        return 0;
    }

    
Not Implemented

Returns:
    public void get_default_subscriber_qos(SubscriberQosHolder qos) {
    }

    
Not Implemented

Returns:
    public int set_default_topic_qos(TopicQos qos) {
        return 0;
    }

    
Not Implemented

Returns:
    public void get_default_topic_qos(TopicQosHolder qos) {
    }

    
Not Implemented

Returns:
    public int enable() {
        return 0;
    }

    
Not Implemented

Returns:
        return null;
    }

    
Not Implemented

Returns:
    public int get_status_changes() {
        return . ;
    }

    

Returns:
Returns the vector_Publisher.
    public Vector getVector_Publisher() {
        return ;
    }

    

Returns:
Returns the vector_Subscriber.
    public Vector getVector_Subscriber() {
        return ;
    }

    

Returns:
Returns the vector_Topic.
    public Vector getVector_Topic() {
        return ;
    }

    

Returns:
    public boolean isDeletable(){
        return getVector_Publisher().isEmpty() && getVector_Subscriber().isEmpty()&& getVector_Topic().isEmpty() ;
    }
New to GrepCode? Check out our FAQ X