Examples of ReferenceDescriptor


Examples of org.apache.avalon.meta.info.ReferenceDescriptor

        final EntryDescriptor[] entries =
            buildEntries( info.getChild( "entries" ).getChildren("entry") );
        final String versionString = info.getChild( "version" ).getValue( "1.0" );
        final Version version = buildVersion( versionString );

        return new Service( new ReferenceDescriptor( classname, version ), entries, attributes );
    }
View Full Code Here

Examples of org.apache.avalon.meta.info.ReferenceDescriptor

    }

    public void setUp()
    {
        m_role = "Test";
        m_reference = new ReferenceDescriptor( DependencyDescriptorTestCase.class.getName(), Version.getVersion( "1.2.1" ) );
    }
View Full Code Here

Examples of org.apache.avalon.meta.info.ReferenceDescriptor

    public void testConstructor()
    {
        try
        {
            new ReferenceDescriptor(null, m_version);
            fail("Did not throw the expected NullPointerException");
        }
        catch (NullPointerException npe)
        {
            // Success!
        }

        try
        {
            new ReferenceDescriptor( null );
            fail( "Did not throw the expected NullPointerException" );
        }
        catch ( NullPointerException npe )
        {
            // Success!
        }

        ReferenceDescriptor ref = new ReferenceDescriptor( m_classname, m_version );
        checkDescriptor( ref, m_classname, m_version );

        ref = new ReferenceDescriptor( m_classname + ":3.2.1" );
        checkDescriptor( ref, m_classname, Version.getVersion("3.2.1"));
    }
View Full Code Here

Examples of org.apache.avalon.meta.info.ReferenceDescriptor

        assertEquals(version, ref.getVersion());
    }

    public void testCompliance()
    {
        ReferenceDescriptor ref = new ReferenceDescriptor( m_classname, m_version );
        ReferenceDescriptor any = new ReferenceDescriptor( m_classname, new Version( -1, 0, 0 ) );

        assertTrue( "anything matches explicit", any.matches( ref ) );
        assertFalse( "explicit does not match anything", ref.matches( any ) );
    }
View Full Code Here

Examples of org.apache.avalon.meta.info.ReferenceDescriptor

        assertFalse( "explicit does not match anything", ref.matches( any ) );
    }

    public void testSerialization() throws IOException, ClassNotFoundException
    {
        ReferenceDescriptor entry = new ReferenceDescriptor( m_classname, m_version );
        checkDescriptor( entry, m_classname, m_version );

        File file = new File( "test.out" );
        ObjectOutputStream oos = new ObjectOutputStream( new FileOutputStream( file ) );
        oos.writeObject( entry );
        oos.close();

        ObjectInputStream ois = new ObjectInputStream( new FileInputStream( file ) );
        ReferenceDescriptor serialized = (ReferenceDescriptor) ois.readObject();
        ois.close();
        file.delete();

        checkDescriptor( entry, m_classname, m_version );

        assertEquals( entry, serialized );
        assertEquals( entry.hashCode(), serialized.hashCode() );
    }
View Full Code Here

Examples of org.apache.avalon.meta.info.ReferenceDescriptor

    {
        final String value = getNamedParameter( tag, TYPE_PARAM );
        final String type = resolveType( value );
        final String versionString = getNamedParameter( tag, VERSION_PARAM, null );
        final Version version = resolveVersion( versionString, value );
        final ReferenceDescriptor ref = new ReferenceDescriptor( type, version );
        return new ServiceDescriptor( ref, null );
    }
View Full Code Here

Examples of org.apache.avalon.meta.info.ReferenceDescriptor

        return new Service(m_reference, m_entries, getProperties());
    }

    public void setUp()
    {
        m_reference = new ReferenceDescriptor(ServiceTestCase.class.getName(), Version.getVersion("1.2.3"));
        m_entries = new EntryDescriptor[] {
            new EntryDescriptor("key", String.class.getName())
        };
    }
View Full Code Here

Examples of org.jbpm.pvm.internal.wire.descriptor.ReferenceDescriptor

  public RefBinding() {
    super("ref");
  }

  public Object parse(Element element, Parse parse, Parser parser) {
    ReferenceDescriptor descriptor = new ReferenceDescriptor();
    if (element.hasAttribute("object")) {
      descriptor.setValue(element.getAttribute("object"));
    } else {
      parse.addProblem("ref must have object attribute: "+XmlUtil.toString(element), element);
    }
    return descriptor;
  }
View Full Code Here

Examples of org.jbpm.pvm.internal.wire.descriptor.ReferenceDescriptor

    // inject the command executor

    if (element.hasAttribute("command-service")) {
      descriptor.addInjection("commandService",
          new ReferenceDescriptor(element.getAttribute("command-service"))
      );
    } else {
      descriptor.addInjection("commandService",
          new ContextTypeRefDescriptor(CommandService.class)
      );
View Full Code Here

Examples of org.jbpm.pvm.internal.wire.descriptor.ReferenceDescriptor

          ExpressionEvaluatorDescriptor expressionDescriptor = new ExpressionEvaluatorDescriptor(expr, lang);
          transition.setConditionDescriptor(expressionDescriptor);
         
        } else if (conditionElement.hasAttribute("ref")) {
          String expr = conditionElement.getAttribute("ref");
          ReferenceDescriptor refDescriptor = new ReferenceDescriptor(expr);
          transition.setConditionDescriptor(refDescriptor);
         
        } else if (ObjectBinding.isObjectDescriptor(conditionElement)) {
          ObjectDescriptor conditionDescriptor = (ObjectDescriptor) objectBinding.parse(conditionElement, parse, parser);
          transition.setConditionDescriptor(conditionDescriptor);
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.