Examples of ResourceDescription


Examples of org.w3c.tools.resources.serialization.ResourceDescription

      throw new RemoteAccessException(ex.getMessage());
  }
    }

    protected void createRemoteFrames() {
  ResourceDescription dframes[] = description.getFrameDescriptions();
  int                 len       = dframes.length;
  this.frames                   = new RemoteResource[len];
  for (int i = 0 ; i < len ; i++) {
      ResourceDescription dframe     = dframes[i];
      String              frameid    = dframe.getIdentifier();
      URL url = null;
      try {
    if (isFrame()) {
        url = new URL(this.url, this.url.getFile()+"?" + frameid);
    } else {
View Full Code Here

Examples of org.w3c.tools.resources.serialization.ResourceDescription

    protected void  writeResourceDescription(ResourceDescription description,
               OutputStream out)
  throws IOException, AdminProtocolException
    {
  try {
      ResourceDescription descrs[] = { description };
      Writer writer = new OutputStreamWriter( out, "UTF-8");
      serializer.writeResourceDescriptions(descrs, writer);
  } catch (SerializationException ex) {
      throw new AdminProtocolException("Unable to serialize resource :"+
               ex.getMessage());
View Full Code Here

Examples of org.w3c.tools.resources.serialization.ResourceDescription

            InputStream in)
  throws IOException, AdminProtocolException
    {
  try {
      Reader reader = new BufferedReader(new InputStreamReader(in));
      ResourceDescription descriptions[] =
    serializer.readResourceDescriptions(reader);
      if (descriptions.length < 1)
    throw new AdminProtocolException("Unknown resource");
      return factory.createRemoteResource(parent,
            identifier,
View Full Code Here

Examples of org.w3c.tools.resources.serialization.ResourceDescription

    public static ResourceDescription readResourceDescription(InputStream in)
  throws IOException, AdminProtocolException
    {
  try {
      Reader reader = new BufferedReader(new InputStreamReader(in));
      ResourceDescription descriptions[] =
    serializer.readResourceDescriptions(reader);
      if (descriptions.length < 1) {
    throw new AdminProtocolException("No resource found.");
      }
      return descriptions[0];
View Full Code Here

Examples of org.w3c.tools.resources.serialization.ResourceDescription

      resourceStack.push(new EmptyDescription(resourceclass,
                identifier));
     
  } else if (iname == iRESOURCE_TAG) {
      String resourceclass = attributes.getValue(CLASS_ATTR);
      resourceStack.push(new ResourceDescription(resourceclass));
      defsStack.push(new Vector(10));
      Vector vcls = new Vector(8);
      vcls.addElement(resourceclass);
      classes.push(vcls);
      interfaces.push(new Vector(8));
View Full Code Here

Examples of org.w3c.tools.resources.serialization.ResourceDescription

  throws SAXException
    {
  endCharacters();
  String iname = name.intern();
  if (iname == iRESOURCE_TAG) {
      ResourceDescription res = (ResourceDescription)resourceStack.pop();
      res.setAttributeDescriptions((Vector)defsStack.pop());
      Vector vresources = (Vector)resourceSetStack.peek();
      vresources.addElement(res);
      Vector vclasses = (Vector)classes.pop();
      res.setClassHierarchy(vclasses);
      Vector vinterfaces = (Vector)interfaces.pop();
      res.setInterfaces(vinterfaces);
  } else if (iname == iCHILDREN_TAG) {
      ResourceDescription res =
    (ResourceDescription)resourceStack.peek();
      res.setChildren(array);
  } else if (iname == iDESCR_TAG) {
      ResourceDescription res = (ResourceDescription)resourceStack.pop();
      Vector vresources = (Vector)resourceSetStack.peek();
      vresources.addElement(res);
  } else if (iname == iATTRIBUTE_TAG) {
      currentS = null;
  } else if (iname == iARRAY_TAG) {
      AttributeDescription ad =
    new AttributeDescription(currentA, currentA.unpickle(array));
      Vector attrs = (Vector)defsStack.peek();
      attrs.addElement(ad);
      currentA = null;
  } else if (iname == iRESARRAY_TAG) {
      Vector vframes = (Vector) resourceSetStack.pop();
      ResourceDescription frames[] =
    new ResourceDescription[vframes.size()];
      vframes.copyInto(frames);
      AttributeDescription ad =
    new AttributeDescription((Attribute)FAStack.pop(),
           frames);
View Full Code Here

Examples of org.w3c.tools.resources.serialization.ResourceDescription

      writer.write("' ");
      writer.write(CLASS_ATTR);
      writer.write("='");
      writer.write(classname);
      writer.write("' ");
      ResourceDescription frames[] = null;
      if (value == null)
    frames = new ResourceDescription[0];
      else
    frames = (ResourceDescription[]) value;
      int len = frames.length;
View Full Code Here

Examples of org.wso2.carbon.rulecep.commons.descriptions.ResourceDescription

                    InputOutputAdaptersConfigurationFactory.create(defaultAdaptersConf,
                            new SynapseXPathFactory());
            inputOutputAdaptersService = new InputOutputAdaptersServiceImpl(configuration);
        }

        ResourceDescription mediatorAsFact = new ResourceDescription();
        mediatorAsFact.setType(MediatorResourceAdapter.TYPE);
        mediatorAsFact.setValue(MediatorResourceAdapter.class.getName());
        InputAdapterFactory inputAdapterFactory = inputOutputAdaptersService.getFactAdapterFactory();
        if (!inputAdapterFactory.containsInputAdapter(MediatorResourceAdapter.TYPE)) {
            inputAdapterFactory.addInputAdapter(mediatorAsFact);
        }
View Full Code Here

Examples of org.wso2.carbon.rulecep.commons.descriptions.ResourceDescription

            QName inputQName = qNameFactory.createQName(CommonsConstants.ELE_FACT,
                    tagQName);
            Iterator inputs = factsElement.getChildrenWithName(inputQName);
            while (inputs.hasNext()) {
                OMElement inputElem = (OMElement) inputs.next();
                ResourceDescription input =
                        ResourceDescriptionFactory.createResourceDescription(inputElem,
                                xPathFactory);
                if (input != null) {
                    ruleMediatorDescription.addFactDescription(input);
                }
            }
        }

        QName resultsQName = qNameFactory.createQName("results", tagQName);
        OMElement resultsElement = configurationXML.getFirstChildWithName(resultsQName);
        if (resultsElement != null) {
            QName outputQName = qNameFactory.createQName(CommonsConstants.ELE_RESULT,
                    tagQName);
            Iterator outputs = resultsElement.getChildrenWithName(outputQName);
            while (outputs.hasNext()) {
                OMElement outputElem = (OMElement) outputs.next();
                ResourceDescription output =
                        ResourceDescriptionFactory.createResourceDescription(outputElem,
                                xPathFactory);
                if (output != null) {
                    ruleMediatorDescription.addResultDescription(output);
                }
View Full Code Here

Examples of org.wso2.carbon.rulecep.commons.descriptions.ResourceDescription

                for (int i = 0; i < factCount; i++) {
                    String name = request.getParameter("factName" + i);
                    String type = request.getParameter("factType" + i);

                    if (type != null && !"".equals(type)) {
                        ResourceDescription resourceDescription = new ResourceDescription();
                        description.addFactDescription(resourceDescription);
                        resourceDescription.addNameSpaces(
                                nameSpacesFactory.createNameSpaces("factValue" + i,
                                        operationName, request.getSession()));
                        resourceDescription.setType(type.trim());
                        if (name != null && !"".equals(name)) {
                            resourceDescription.setName(name.trim());
                        }
                    }
                }
            } catch (NumberFormatException ignored) {
            }
        }

        String wrapperName = request.getParameter("wrapperName");
        if (wrapperName == null || "".equals(wrapperName)) {
            wrapperName = RuleConstants.DEFAULT_WRAPPER_NAME;
        }

        ResourceDescription wrapperDescription = new ResourceDescription();
        wrapperDescription.setType(OMElementResourceAdapter.TYPE);
        wrapperDescription.setName(wrapperName);
        String resultCountParameter = request.getParameter("resultCount");

        if (resultCountParameter != null && !"".equals(resultCountParameter)) {
            int resultCount = 0;
            try {
                resultCount = Integer.parseInt(resultCountParameter.trim());

                for (int i = 0; i < resultCount; i++) {
                    String name = request.getParameter("resultName" + i);
                    String type = request.getParameter("resultType" + i);

                    if (type != null && !"".equals(type)) {
                        ResourceDescription resourceDescription = new ResourceDescription();
                        wrapperDescription.addChildResource(resourceDescription);
                        resourceDescription.addNameSpaces(
                                nameSpacesFactory.createNameSpaces("resultValue" + i,
                                        operationName, request.getSession()));
                        resourceDescription.setType(type.trim());
                        if (name != null && !"".equals(name)) {
                            resourceDescription.setName(name.trim());
                        }
                    }
                }
            } catch (NumberFormatException ignored) {
            }
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.