Package org.apache.ws.resource.properties.impl

Examples of org.apache.ws.resource.properties.impl.XmlBeansResourceProperty


        setPrinterState(PrinterStateType.PROCESSING);
    }

    private void setPrinterState(PrinterStateType.Enum printerState)
    {
        XmlBeansResourceProperty resourceProperty = (XmlBeansResourceProperty) getResourcePropertySet().get(PrinterPortPropertyQNames.PRINTER_STATE);
        PrinterStateType state = (PrinterStateType) resourceProperty.get(0);
        state.set(printerState);
    }
View Full Code Here


        resetTimer();//restart timer
    }

    private boolean isJobCancelledOrAborted(JobPortResource job)
    {
        XmlBeansResourceProperty resourceProperty = (XmlBeansResourceProperty) job.getResourcePropertySet().get(JobPortPropertyQNames.JOB_STATE);
        JobStateType o = (JobStateType) resourceProperty.get(0);
        org.apache.xmlbeans.StringEnumAbstractBase stateVal = o.enumValue();
        return stateVal == JobStateType.ABORTED || stateVal == JobStateType.CANCELED || stateVal == JobStateType.COMPLETED;
    }
View Full Code Here

        return stateVal == JobStateType.ABORTED || stateVal == JobStateType.CANCELED || stateVal == JobStateType.COMPLETED;
    }

    private void setJobState(JobPortResource job, JobStateType.Enum state)
    {
        XmlBeansResourceProperty resourceProperty = (XmlBeansResourceProperty) job.getResourcePropertySet().get(JobPortPropertyQNames.JOB_STATE);
        JobStateType o = null;
        if (resourceProperty != null)
        {
         o = (JobStateType) resourceProperty.get(0);
         o.set(state);
        }

        resourceProperty = (XmlBeansResourceProperty) getResourcePropertySet().get(JobPortPropertyQNames.JOB_STATE);
        if (resourceProperty != null)
        {
            o = (JobStateType) resourceProperty.get(0);
            o.set(state);
        }
    }
View Full Code Here

        setPrinterState(PrinterStateType.IDLE);
    }

    private boolean isPrinterStopped()
    {
        XmlBeansResourceProperty resourceProperty = (XmlBeansResourceProperty) getResourcePropertySet().get(PrinterPortPropertyQNames.PRINTER_STATE);
        PrinterStateType state = (PrinterStateType) resourceProperty.get(0);
        return state.enumValue() == PrinterStateType.STOPPED;
    }
View Full Code Here

        return state.enumValue() == PrinterStateType.STOPPED;
    }

    private void decrementQueueCount()
    {
        XmlBeansResourceProperty resourceProperty = (XmlBeansResourceProperty) getResourcePropertySet().get(PrinterPortPropertyQNames.QUEUED_JOB_COUNT);
        XmlInteger count = (XmlInteger) resourceProperty.get(0);
        int intCount = count.getBigIntegerValue().intValue();
        --intCount;
        count.setBigIntegerValue(BigInteger.valueOf(intCount));
    }
View Full Code Here

        AnyResourcePropertyMetaData anyMeta = new AnyResourcePropertyMetaData(new QName("foo"));

        //need some sort of documenttype
        NotifyDocument doc = NotifyDocument.Factory.newInstance();
        XmlBeansResourcePropertySet set = new XmlBeansResourcePropertySet(doc);
        XmlBeansResourceProperty prop = new XmlBeansResourceProperty(anyMeta,set);
        ResourcePropertyValueChangeTopicImpl topic = new ResourcePropertyValueChangeTopicImpl(prop);
        TopicListenerTestObj testListenr = new TopicListenerTestObj();
        topic.addTopicListener(testListenr);
        lis.topicChanged(topic);
    }
View Full Code Here

    public void init()
    {
        super.init();
        //create a resource metadata and resource property
        ResourcePropertyMetaData propMetaData = new AnyResourcePropertyMetaData( new QName( JavaSysPropsService.TARGET_NSURI, ELEM_NAME_PROPERTY ) );
        ResourceProperty prop = new XmlBeansResourceProperty( propMetaData, (XmlBeansResourcePropertySet) m_propSet );
        //add the property to the prop set
        m_propSet.add( prop );

        //get the current sys properties
        Properties sysProps = System.getProperties();
        Iterator iterator = sysProps.keySet().iterator();
        //iterate the sysprops and add to property set
        while ( iterator.hasNext() )
        {
            String sysPropKey = (String) iterator.next();
            String sysPropValue = sysProps.getProperty( sysPropKey );
            try
            {
                //build an arbitrary XmlObject out of the sysprop data
                XmlObject propElem = XmlObject.Factory.parse( "<" + JavaSysPropsService.TARGET_NSPREFIX + ":" + ELEM_NAME_PROPERTY + " name=\"" + sysPropKey + "\" value=\"" + sysPropValue + "\" xmlns:" + JavaSysPropsService.TARGET_NSPREFIX + "=\"" + JavaSysPropsService.TARGET_NSURI + "\"/>" );
                prop.add( propElem );
            }
            catch ( XmlException e )
            {
                e.printStackTrace();
            }
View Full Code Here

            (PrinterPortHome) initialContext.lookup( PrinterPortHome.HOME_LOCATION );
         PrinterPortResource instance        =
            (PrinterPortResource) printerPortHome.createPrinter();

         //get Resource Prop for Printer Ref
         XmlBeansResourceProperty prop =
            (XmlBeansResourceProperty) instance.getResourcePropertySet(  ).get( PrinterPortPropertyQNames.PRINTER_REFERENCE );

         //set the Printer EPR on the response
         createPrinterResponse.setPrinterReference( (EndpointReferenceType) prop.toXmlObjects(  )[0] );
      }
      catch ( Exception e )
      {
         throw new ResourceUnknownFaultException( new NamespaceVersionHolderImpl(  ),
                                                  new ResourceUnknownException( null,
View Full Code Here

      catch ( Exception e )
      {
         throw new ClientErrorNotPossibleFaultException(new NamespaceVersionHolderImpl(), "Problem occurred when retrieving resource: " + e.getLocalizedMessage());
      }

      XmlBeansResourceProperty resourceProperty =
         (XmlBeansResourceProperty) resource.getResourcePropertySet(  ).get( PrinterPortPropertyQNames.PRINTER_IS_ACCEPTING_JOBS );
      XmlBoolean               doc = (XmlBoolean) resourceProperty.get( 0 );
      return doc.getBooleanValue(  );
   }
View Full Code Here

        setPrinterState(PrinterStateType.PROCESSING);
    }

    private void setPrinterState(PrinterStateType.Enum printerState)
    {
        XmlBeansResourceProperty resourceProperty = (XmlBeansResourceProperty) getResourcePropertySet().get(PrinterPortPropertyQNames.PRINTER_STATE);
        PrinterStateType state = (PrinterStateType) resourceProperty.get(0);
        state.set(printerState);
    }
View Full Code Here

TOP

Related Classes of org.apache.ws.resource.properties.impl.XmlBeansResourceProperty

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.