Examples of Definition


Examples of javax.wsdl.Definition

                                    manager.getClass().getClassLoader());
            } catch (ClassNotFoundException ex) {
                LOG.log(Level.INFO, "SEI_LOAD_FAILURE_MSG", ex);
                return null;
            }
            Definition def = manager.getDefinition(sei);
            if (def == null && sei.getInterfaces().length > 0) {
                sei = sei.getInterfaces()[0];
                def = manager.getDefinition(sei);
            }
            return def;
View Full Code Here

Examples of javax.wsdl.Definition

        }
        return schemaList;
    }

    public static Schema getSchema(WSDLManager manager, EndpointReferenceType ref) {
        Definition definition;
        try {
            definition = getWSDLDefinition(manager, ref);
        } catch (javax.wsdl.WSDLException wsdlEx) {
            return null;
        }
View Full Code Here

Examples of javax.wsdl.Definition

     * @return Port the wsdl port
     * @throws WSDLException
     */
    public static Port getPort(WSDLManager manager, EndpointReferenceType ref) throws WSDLException {

        Definition def = getWSDLDefinition(manager, ref);
        if (def == null) {
            throw new WSDLException(WSDLException.OTHER_ERROR, "unable to find definition for reference");
        }

        MetadataType metadata = ref.getMetadata();
        for (Object obj : metadata.getAny()) {
           
            if (obj instanceof JAXBElement) {
                Object jaxbVal = ((JAXBElement)obj).getValue();

                if (jaxbVal instanceof ServiceNameType) {
                    Port port = null;
                    ServiceNameType snt = (ServiceNameType)jaxbVal;
                    LOG.log(Level.FINEST, "found service name ", snt.getEndpointName());
                    Service service = def.getService(snt.getValue());
                    if (service == null) {
                        service = (Service)def.getServices().values().iterator().next();
                        if (service == null) {
                            return null;
                        }
                    }
                    String endpoint = snt.getEndpointName();
                    if ("".equals(endpoint) && service.getPorts().size() == 1) {
                        port = (Port)service.getPorts().values().iterator().next();
                    } else {
                        port = service.getPort(endpoint);
                    }
                    // FIXME this needs to be looked at service.getPort(endpoint)
                    //should not return null when endpoint is valid
                    if (port == null) {
                        port = (Port)service.getPorts().values().iterator().next();
                    }
                    return port;
                }
            }
        }

        if (def.getServices().size() == 1) {
            Service service = (Service)def.getServices().values().iterator().next();
            if (service.getPorts().size() == 1) {
                return (Port)service.getPorts().values().iterator().next();
            }
        }
       
        QName serviceName = getServiceName(ref);
        if (null != serviceName) {
            Service service = def.getService(serviceName);
            if (service == null) {
                throw new WSDLException(WSDLException.OTHER_ERROR, "Cannot find service for " + serviceName);
            }
            if (service.getPorts().size() == 1) {
                return (Port)service.getPorts().values().iterator().next();
View Full Code Here

Examples of javax.wsdl.Definition

        assertNotNull(bus);
        EndpointReferenceType reference = binding.getEndpointReference();
        assertNotNull(reference);

        // test wsdl definition from the endpoint reference
        Definition wsdlDef = EndpointReferenceUtils.getWSDLDefinition(bus.getWSDLManager(), reference);
        assertNotNull(wsdlDef);
        QName wsdlName = new QName("http://objectweb.org/hello_world_xml_http/bare", "HelloWorld");
        assertEquals(wsdlDef.getQName(), wsdlName);
       
        Port port = EndpointReferenceUtils.getPort(bus.getWSDLManager(), reference);
        assertNotNull(port);
        Binding b = port.getBinding();
        assertNotNull(b);
View Full Code Here

Examples of javax.wsdl.Definition

  public  List getWsdlPortTypeByUri( String wsdlURI ){

    WSDLFactory fact;
    WSDLReader read;
    Definition def;
    Map map;

    String dir = this.getAppPath(this.getClass());
    dir = dir.replace('/', File.separatorChar);
    dir = dir.substring(0, dir.lastIndexOf(File.separator));
    dir = dir.substring(0, dir.lastIndexOf(File.separator));

    wsdlURI = dir + File.separator + wsdlURI;
    wsdlURI = wsdlURI.replace('\\', File.separatorChar);
    try {
      fact = WSDLFactory.newInstance();
      read = fact.newWSDLReader();
      def = read.readWSDL(wsdlURI);
      map = def.getPortTypes();

      PortType p = new PortTypeImpl() ;
      QName qname = p.getQName();
      //Operation op = p.getOperation(wsdlURI, wsdlURI, wsdlURI);
      //op.getName()
View Full Code Here

Examples of javax.wsdl.Definition

  public  List getWsdlPortTypeBycaracterStream( Reader caracterStream ){

    WSDLFactory fact;
    WSDLReader read;
    Definition def;
    Map map;

    try {
      fact = WSDLFactory.newInstance();
      read = fact.newWSDLReader();
      def = read.readWSDL(null,new InputSource(caracterStream));
      map = def.getPortTypes();

      wsdl.PortTypeImplm portType;
      wsdl.OperationImplm operation;
      List<wsdl.PortTypeImplm> portTypeList = new ArrayList<wsdl.PortTypeImplm>();
      List<wsdl.OperationImplm> operationList = new ArrayList<wsdl.OperationImplm>();
View Full Code Here

Examples of marauroa.common.game.Definition

   * Tests for isParsableByInteger.
   */
  @Test
  public final void testIsParsableByInteger() {
    AlterAction action = new AlterAction();
      Definition def = new Definition();
       def.setType(BYTE);
    assertTrue(action.isParsableByInteger(def));   

    def.setType(FLAG);
    assertFalse(action.isParsableByInteger(def));   

   
    def.setType(INT);
    assertTrue(action.isParsableByInteger(def));   

    def.setType(LONG_STRING);
    assertFalse(action.isParsableByInteger(def));   

    def.setType(NOTYPE);
    assertFalse(action.isParsableByInteger(def));   

    def.setType(SHORT);
    assertTrue(action.isParsableByInteger(def));   

    def.setType(STRING);
    assertFalse(action.isParsableByInteger(def));   

    def.setType(VERY_LONG_STRING);
    assertFalse(action.isParsableByInteger(def));

    def.setType(FLOAT);
    assertFalse(action.isParsableByInteger(def));   

  }
View Full Code Here

Examples of marauroa.common.game.Definition

      }

      final RPClass clazz = changed.getRPClass();


      final Definition type = clazz.getDefinition(DefinitionClass.ATTRIBUTE, stat);
      if (type == null) {
        player.sendPrivateText("Attribute you are altering is not defined in RPClass("
            + changed.getRPClass().getName() + ")");
        return;
      } else {
        final String value = action.get(VALUE);
        final String mode = action.get(MODE);

        if ((mode.length() > 0) && !mode.equalsIgnoreCase(ADD)
            && !mode.equalsIgnoreCase(SUB) && !mode.equalsIgnoreCase(SET) && !mode.equalsIgnoreCase(UNSET)) {
          player.sendPrivateText("Please issue one of the modes 'add', 'sub', 'set' or 'unset'.");
          return;
        }

        if (isParsableByInteger(type)) {
          int numberValue;

          try {
            numberValue = Integer.parseInt(value);
          } catch (final NumberFormatException e) {
            player.sendPrivateText("Please issue a numeric value instead of '" + value + "'");
            return;
          }

          if (mode.equalsIgnoreCase(ADD)) {
            numberValue = changed.getInt(stat) + numberValue;
          }

          if (mode.equalsIgnoreCase(SUB)) {
            numberValue = changed.getInt(stat) - numberValue;
          }

          if (ATTR_HP.equals(stat) && (changed.getInt("base_hp") < numberValue)) {
            logger.info("Admin " + player.getName() + " trying to set entity "
                + Grammar.suffix_s(action.get(TARGET)) + " HP over its Base HP, "
                + "we instead restored entity " + action.get(TARGET) + " to full health.");
            numberValue = changed.getInt("base_hp");
          }

          if (ATTR_HP.equals(stat) && (numberValue <= 0)) {
            logger.error("DENIED: Admin " + player.getName() + " trying to set entity "
                + Grammar.suffix_s(action.get(TARGET)) + " HP to 0, making it so unkillable.");
            return;
          }

          switch (type.getType()) {
          case BYTE:
            if ((numberValue > Byte.MAX_VALUE)
                || (numberValue < Byte.MIN_VALUE)) {
              return;
            }
            break;
          case SHORT:
            if ((numberValue > Short.MAX_VALUE)
                || (numberValue < Short.MIN_VALUE)) {
              return;
            }
            break;
          case INT:
            /*
             * as numberValue is currently of type integer, this is
             * pointless: if ((numberValue > Integer.MAX_VALUE) ||
             * (numberValue < Integer.MIN_VALUE)) { return; }
             */
            break;
          default:
              // we switch over an enum
              break;
          }
         
          new GameEvent(player.getName(), ALTER, action.get(TARGET), stat, Integer.toString(numberValue)).raise();
          changed.put(stat, numberValue);
        } else {
          // If value is not a number, only SET and UNSET can be used
          if (mode.equalsIgnoreCase(SET)) {
            new GameEvent(player.getName(), ALTER, action.get(TARGET), stat, action.get(VALUE)).raise();
            changed.put(stat, action.get(VALUE));

          } else if (mode.equalsIgnoreCase(UNSET)) {
            if (type.getType() != Type.FLAG) {
              player.sendPrivateText("Attribute to be unset is not of type 'flag'.");
              return;
            }
            new GameEvent(player.getName(), ALTER, action.get(TARGET), stat, "unset").raise();
            changed.remove(stat);
View Full Code Here

Examples of net.sf.block.Definition

    PairedTemplateAssembler a = new PairedTemplateAssembler();
    int counter = 0;
    int bases = 0;
    long size = 0;
   
    Definition definition = new Definition();
    definition.contentId = "input.bam".getBytes();
    definition.formatMajor = 1;
    definition.formatMinor = 0;
    definition.magick = "CRAM".getBytes();
    Format format = new FormatFactory().createFormat(definition);
View Full Code Here

Examples of net.sf.minuteProject.loader.init.node.Definition

  }
 
  private void loadDefinition(InitHolder initholder) throws Exception {
    Configuration configuration = initholder.getConfiguration();
    if (configuration!=null) {
      Definition definition = configuration.getDefinition();
      if (definition!=null) {
        String filename = definition.getFilename();
        String dir = definition.getDir();
        loadDefinition (dir, filename)
      }
    }
  }
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.