Package org.apache.ws.notification.topics

Examples of org.apache.ws.notification.topics.TopicSpace


        * nternaly the code :
        * TopicSpace muwsTopicSpace = new TopicSpaceImpl( MuwsConstants.NSURI_MUWS_PART2_TOPICS )
        * aSet.addTopicSpace( muwsTopicSpace ) is executed. We are adding more MUWS topics to this
        * TopicSpace.
       */
        TopicSpace muwsTopicSpace = MuwsUtils.addRelationshipTopics( aSet );

         ManagementEventTopic identityCapability =
            new XmlBeansManagementEventTopicImpl( IdentityCapability.TOPIC_NAME );
         muwsTopicSpace.addTopic( identityCapability );
         ManagementEventTopic manageabilityCharacteristicsCapability =
            new XmlBeansManagementEventTopicImpl( ManageabilityCharacteristicsCapability.TOPIC_NAME );
         muwsTopicSpace.addTopic( manageabilityCharacteristicsCapability );

         ManagementEventTopic muwsDescriptionCapability =
            new XmlBeansManagementEventTopicImpl( DescriptionCapability.TOPIC_NAME );
         muwsTopicSpace.addTopic( muwsDescriptionCapability );

         ManagementEventTopic metricCapability =
            new XmlBeansManagementEventTopicImpl( MetricsCapability.TOPIC_NAME );
         muwsTopicSpace.addTopic( metricCapability );

         // OperationalStatusCapability MUWS topic - add subtopics for AvailableDiskSpace
         ManagementEventTopic operationalStatCapability =
            new XmlBeansManagementEventTopicImpl( OperationalStatusCapability.TOPIC_NAME );

         //ManagementEventTopic statusDiskSpace = new XmlBeansManagementEventTopicImpl( ApplicationHome.AVAILABLE_DISK_TOPIC );
         //operationalStatCapability.addTopic(statusDiskSpace);
         muwsTopicSpace.addTopic( operationalStatCapability );

         m_eventScheduler = new EventScheduler( this );

         //MOWS TopicSpace
         TopicSpace mowsTopicSpace = new TopicSpaceImpl( MowsConstants.NSURI_MOWS_TOPICS );
         getTopicSpaceSet(  ).addTopicSpace( mowsTopicSpace );

         ManagementEventTopic mowsMetricsCapability =
            new XmlBeansManagementEventTopicImpl( MetricsCapability.TOPIC_NAME );
         mowsTopicSpace.addTopic( mowsMetricsCapability );

         // init the {http://ws.apache.org/muse/example/application/properties}TotalNumberOfRequests Resource Property
         resourceProperty = resourcePropertySet.get( ApplicationPropertyQNames.TOTALNUMBEROFREQUESTS );
         org.apache.ws.muse.example.application.properties.TotalNumberOfRequestsDocument prop_totalnumberofrequests =
            org.apache.ws.muse.example.application.properties.TotalNumberOfRequestsDocument.Factory.newInstance(  );
View Full Code Here


         //    create the backend object associated with this resource
         m_instance = new HostInstance( getID(  ).toString(  ) );
         TopicSpaceSet aSet = getTopicSpaceSet(  );

         //MUWS TopicSpace
         TopicSpace muwsTopicSpace = new TopicSpaceImpl( MuwsConstants.NSURI_MUWS_PART2_TOPICS );
         aSet.addTopicSpace( muwsTopicSpace );

         ManagementEventTopic identityCapability =
            new XmlBeansManagementEventTopicImpl( IdentityCapability.TOPIC_NAME );
         muwsTopicSpace.addTopic( identityCapability );
         ManagementEventTopic manageabilityCharacteristicsCapability =
            new XmlBeansManagementEventTopicImpl( ManageabilityCharacteristicsCapability.TOPIC_NAME );
         muwsTopicSpace.addTopic( manageabilityCharacteristicsCapability );

         ManagementEventTopic muwsDescriptionCapability =
            new XmlBeansManagementEventTopicImpl( DescriptionCapability.TOPIC_NAME );
         muwsTopicSpace.addTopic( muwsDescriptionCapability );

         ManagementEventTopic metricCapability =
            new XmlBeansManagementEventTopicImpl( MetricsCapability.TOPIC_NAME );
         muwsTopicSpace.addTopic( metricCapability );

         //MOWS TopicSpace
         TopicSpace mowsTopicSpace = new TopicSpaceImpl( MowsConstants.NSURI_MOWS_TOPICS );
         getTopicSpaceSet(  ).addTopicSpace( mowsTopicSpace );

         ManagementEventTopic mowsMetricsCapability =
            new XmlBeansManagementEventTopicImpl( MetricsCapability.TOPIC_NAME );
         mowsTopicSpace.addTopic( mowsMetricsCapability );

         // init the {http://ws.apache.org/muse/example/host/properties}CpuUsage Resource Property
         resourceProperty = resourcePropertySet.get( HostPropertyQNames.CPUUSAGE );
         org.apache.ws.muse.example.host.properties.CpuUsageDocument prop_cpuusage =
            org.apache.ws.muse.example.host.properties.CpuUsageDocument.Factory.newInstance(  );
View Full Code Here

         prop_supportedresources.setSupportedResources( supportedTypes );
         resourceProperty.add( prop_supportedresources );

         // Topics
         org.apache.ws.notification.topics.TopicSpaceSet topicSpaceSet  = getTopicSpaceSet(  );
         TopicSpace                                      muwsTopicSpace =
            new TopicSpaceImpl( MuwsConstants.NSURI_MUWS_PART2_TOPICS );

         Topic                                           manageabilityEndpointCreation    =
            new XmlBeansAdvertisementTopicImpl( AdvertisementCapability.TOPIC_MANAGEABILITY_ENPOINT_CREATION_NAME,
                                                false );
         Topic                                           manageabilityEndpointDestruction =
            new XmlBeansAdvertisementTopicImpl( AdvertisementCapability.TOPIC_MANAGEABILITY_ENPOINT_DESTRUCTION_NAME,
                                                false );

         XmlBeansAdvertisementTopicImpl                  manageableResourceCreation    =
            new XmlBeansAdvertisementTopicImpl( AdvertisementCapability.TOPIC_MANAGEABLE_RESOURCE_CREATION_NAME );
         XmlBeansAdvertisementTopicImpl                  manageableResourceDestruction =
            new XmlBeansAdvertisementTopicImpl( AdvertisementCapability.TOPIC_MANAGEABLE_RESOURCE_DESTRUCTION_NAME );

         //register listeners for those topics with all known to resourceadmin  homes....
         addListenersToHomes( manageableResourceCreation, manageableResourceDestruction );

         manageabilityEndpointCreation.addTopic( manageableResourceCreation );
         manageabilityEndpointDestruction.addTopic( manageableResourceDestruction );
         muwsTopicSpace.addTopic( manageabilityEndpointCreation );
         muwsTopicSpace.addTopic( manageabilityEndpointDestruction );
         topicSpaceSet.addTopicSpace( muwsTopicSpace );

         ManagementEventTopic identityCapability =
            new XmlBeansManagementEventTopicImpl( IdentityCapability.TOPIC_NAME );
         muwsTopicSpace.addTopic( identityCapability );
         ManagementEventTopic manageabilityCharacteristicsCapability =
            new XmlBeansManagementEventTopicImpl( ManageabilityCharacteristicsCapability.TOPIC_NAME );
         muwsTopicSpace.addTopic( manageabilityCharacteristicsCapability );
         ManagementEventTopic operationalStatusCapability =
            new XmlBeansManagementEventTopicImpl( OperationalStatusCapability.TOPIC_NAME );
         muwsTopicSpace.addTopic( operationalStatusCapability );
         ManagementEventTopic muwsDescriptionCapability =
            new XmlBeansManagementEventTopicImpl( DescriptionCapability.TOPIC_NAME );
         muwsTopicSpace.addTopic( muwsDescriptionCapability );
         ManagementEventTopic metricCapability =
            new XmlBeansManagementEventTopicImpl( MetricsCapability.TOPIC_NAME );
         muwsTopicSpace.addTopic( metricCapability );

         // init the {http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd}ResourceId Resource Property
         resourceProperty = resourcePropertySet.get( ResourceadminPropertyQNames.RESOURCEID );
         org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ResourceIdDocument prop_resourceid =
            org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart1.ResourceIdDocument.Factory.newInstance(  );
View Full Code Here

    private List evaluateTopicPath( TopicSpaceSet topicSpaceSet, QName topicPath )
            throws TopicExpressionResolutionException, InvalidTopicExpressionException
    {
        List matchedTopics = new ArrayList();
        TopicSpace topicSpace = getTopicSpace( topicSpaceSet, topicPath );
        if ( topicPath.getLocalPart().indexOf( "/" ) != -1 ||
             topicPath.getLocalPart().indexOf( "*" ) != -1 ||
             topicPath.getLocalPart().indexOf( "|" ) != -1 ||
             topicPath.getLocalPart().indexOf( "." ) != -1 )
        {
            throw new InvalidTopicExpressionException( "Topic path '" + topicPath +
                    "' contains one or more illegal characters ('/', '*', '|' or '.')." );
        }
        String name = topicPath.getLocalPart();
        Topic topic = topicSpace.getTopic( name );
        if ( topic != null )
        {
            matchedTopics.add( topic );
        }
        return matchedTopics;
View Full Code Here

    private List evaluateTopicPath( TopicSpaceSet topicSpaceSet, QName topicPath )
            throws TopicExpressionResolutionException, InvalidTopicExpressionException
    {
        List matchedTopics = new ArrayList();
        TopicSpace topicSpace = getTopicSpace( topicSpaceSet, topicPath );
        if ( topicPath.getLocalPart().indexOf( "///" ) != -1 )
        {
            throw new InvalidTopicExpressionException( "Topic path '" + topicPath +
                    "' contains an empty path component." );
        }
View Full Code Here

    {
        String namespaceURI = topicSpace.getTargetNamespace();
        //if topicSpace exists, simply add all topics to topicspace
        if(m_topicSpaces.containsKey(namespaceURI))
        {
            TopicSpace topicSpc = (TopicSpace) m_topicSpaces.get(namespaceURI);
            Iterator iterator = topicSpc.topicIterator();
            while (iterator.hasNext())
            {
                Topic topic = (Topic) iterator.next();
                topicSpace.addTopic(topic);
            }
View Full Code Here

    public static Topic addResourceTerminationTopic(TopicSpaceSet topicSpaceSet, Resource resource, NamespaceVersionHolder namespaces)
            throws Exception
    {
        //there can be only 1 !
        String namespace = namespaces.getLifetimeXsdNamespace();       
        TopicSpace topicSpace = topicSpaceSet.getTopicSpace(namespace);
        if (topicSpace == null)
        {
            topicSpace = new TopicSpaceImpl(namespace);
            topicSpaceSet.addTopicSpace(topicSpace);
        }
        Topic topic;
        if (topicSpace.topicIterator().hasNext())
        {
            topic = (Topic) topicSpace.topicIterator().next();
        }
        else
        {
            topic = new ResourceTerminationTopicImpl(namespaces);
            resource.addTerminationListener((ResourceTerminationListener) topic);
            topicSpace.addTopic(topic);
        }
        return topic;
    }
View Full Code Here

            throw new IllegalArgumentException( "Property " + prop.getMetaData().getName() + " is readonly!" );
        }
        ResourcePropertyValueChangeTopic valueChangeTopic = new ResourcePropertyValueChangeTopicImpl( prop );
        prop.addChangeListener( valueChangeTopic );
        String topicNsURI = prop.getMetaData().getName().getNamespaceURI();
        TopicSpace topicSpace = topicSpaceSet.getTopicSpace( topicNsURI );
        if ( topicSpace == null )
        {
            topicSpace = new TopicSpaceImpl( topicNsURI );
            topicSpaceSet.addTopicSpace( topicSpace );
        }
        topicSpace.addTopic( valueChangeTopic );       
        return valueChangeTopic;
    }
View Full Code Here

        //setup the Topic property
        resourceProperty = propSet.get(NotificationProducerPortType.PROP_QNAME_TOPIC);
        TopicSpace[] topicSpaces = topicSpaceSet.getTopicSpaces();
        for (int i = 0; i < topicSpaces.length; i++)
        {
            TopicSpace topicSpace = topicSpaces[i];
            String targetNamespace = topicSpace.getTargetNamespace();
            Iterator iterator = topicSpace.topicIterator();
            while (iterator.hasNext())
            {
                Topic topic =  (Topic)iterator.next();
                String topicName = topic.getName();
                QName rootTopicQName = new QName(targetNamespace, topicName);
View Full Code Here

    }

    protected TopicSpace getTopicSpace( TopicSpaceSet topicSpaceSet, QName topicPath )
            throws TopicExpressionResolutionException
    {
        TopicSpace topicSpace = topicSpaceSet.getTopicSpace( topicPath.getNamespaceURI() );
        if ( topicSpace == null )
        {
            throw new TopicExpressionResolutionException( "Topic path '" + topicPath.getPrefix() + ":" +
                    topicPath.getLocalPart() +
                    "' references an unknown TopicSpace with namespace URI '" +
View Full Code Here

TOP

Related Classes of org.apache.ws.notification.topics.TopicSpace

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.