Examples of ResourceReference


Examples of fr.imag.adele.apam.declarations.references.resources.ResourceReference

   * part of the validation and repository API directly to the declarations package.
   */
  protected boolean isCandidateTarget(RelationDeclaration relation, ComponentDeclaration candidate) {

    ComponentReference<?> targetComponent  = relation.getTarget().as(ComponentReference.class);
    ResourceReference targetResource     = relation.getTarget().as(ResourceReference.class);

    if (targetComponent != null) {
      return isAncestor(candidate,targetComponent,true);
    }
    else if (targetResource != null) {
View Full Code Here

Examples of fr.imag.adele.apam.declarations.references.resources.ResourceReference

    if (getGroupRelation().getTarget() instanceof ResourceReference) {
   
      /*
       * If the group targets a resource
       */
      ResourceReference groupTarget = getGroupRelation().getTarget().as(ResourceReference.class);
     
      /*
       * and the refinement targets a resource it must match
       */
      if (targetIsResource() && !getTargetReference().equals(groupTarget)) {
        error("Invalid target refinement in relation " + quoted(getRelation().getIdentifier()) + ", "+getTargetReference()+ " is not compatible with "+groupTarget);
      }
     
      /*
       * and the refinement targets a component, it must provide the resource
       */
      if (targetIsComponent() && getTarget() != null && !getTarget().getProvidedResources().contains(groupTarget)) {
        error("Invalid target refinement in relation " + quoted(getRelation().getIdentifier()) + ", "+getTargetReference()+ " doesn't provide the resource specified in the group "+groupTarget);
      }
    }
   
    if (getGroupRelation().getTarget() instanceof ComponentReference) {
     
      /*
       * If the group targets a component
       */
      ComponentDeclaration groupTarget = getComponent(getGroupRelation().getTarget().as(ComponentReference.class),true);

      /*
       * and the refinement targets a resource, it must be provided by the component
       */
      if (targetIsResource() && groupTarget != null && !groupTarget.getProvidedResources().contains(getTargetReference())) {
        error("Invalid target refinement in relation " + quoted(getRelation().getIdentifier()) + ", "+getTargetReference()+ " is not provided by the component specified in the group "+groupTarget.getName());
      }

      if (targetIsComponent() && getTarget() != null && groupTarget != null) {

        /*
         * and the refinement targets a most concrete component, it must be a descendant
         */

        if (groupTarget.getKind().isMoreAbstractThan(getTarget().getKind()) && ! isAncestor(getTarget(), groupTarget.getReference(),true)) {
          error("Invalid target refinement in relation " + quoted(getRelation().getIdentifier()) + ", "+getTargetReference()+ " is not a descendant of the component specified in the group "+groupTarget.getName());
        }
       
        /*
         * and the refinement targets a most abstract  component, it must be an ancestor
         */
        if (getTarget().getKind().isMoreAbstractThan(groupTarget.getKind()) && ! isAncestor(groupTarget,getTarget().getReference(),true)) {
          error("Invalid target refinement in relation " + quoted(getRelation().getIdentifier()) + ", "+getTargetReference()+ " is not a ancestor of the component specified in the group "+groupTarget.getName());
        }

        /*
         * and the refinement targets a equally abstract  component, it must be the samer
         */
        if (getTarget().getKind().equals(groupTarget.getKind()) && ! getTarget().equals(groupTarget)) {
          error("Invalid target refinement in relation " + quoted(getRelation().getIdentifier()) + ", "+getTargetReference()+ " is not compatible with the component specified in the group "+groupTarget.getName());
        }
       
      }
     
    }
View Full Code Here

Examples of fr.imag.adele.apam.declarations.references.resources.ResourceReference

    /*
     * validate missing exception
     */

    if (getRelation().getMissingException() != null) {
      checkResourceExists(new ResourceReference(getRelation().getMissingException()));
    }
   
  }
View Full Code Here

Examples of org.apache.geronimo.naming.reference.ResourceReference

        earContext.addGBean(connectionFactoryGBeanData);
    }

    //ResourceReferenceBuilder implementation
    public Reference createResourceRef(String containerId, Class iface) throws DeploymentException {
        return new ResourceReference(containerId, iface);
    }
View Full Code Here

Examples of org.apache.geronimo.naming.reference.ResourceReference

    public Reference createResourceRef(String containerId, Class iface) throws DeploymentException {
        return new ResourceReference(containerId, iface);
    }

    public Reference createAdminObjectRef(String containerId, Class iface) throws DeploymentException {
        return new ResourceReference(containerId, iface);
    }
View Full Code Here

Examples of org.apache.tuscany.sca.contribution.resolver.ResourceReference

       
        for (Component component : composite.getComponents()) {
          for (ComponentProperty prop : component.getProperties()) {
            String file = prop.getFile();
             if (file != null) {
              ResourceReference resourceRef = new ResourceReference(file);
              resourceRef = resolver.resolveModel(ResourceReference.class, resourceRef);

              try {
                  if (!resourceRef.isUnresolved()) {
              prop.setFile(resourceRef.getResource().toURI().toString());
           
                  }
              } catch (URISyntaxException e) {
                    throw new IllegalArgumentException(e);
                  }
View Full Code Here

Examples of org.apache.webbeans.api.ResourceReference

                {
                    Annotation ann = AnnotationUtil.hasOwbInjectableResource(field.getDeclaredAnnotations());
                    if(ann != null)
                    {
                        @SuppressWarnings("unchecked")
                        ResourceReference<Object, ?> resourceRef = new ResourceReference(field.getDeclaringClass(), field.getName(), field.getType(), ann);
                        boolean acess = field.isAccessible();
                        try
                        {
                            field.setAccessible(true);
                            field.set(managedBeanInstance, getResourceReference(resourceRef));
View Full Code Here

Examples of org.apache.webbeans.spi.api.ResourceReference

                Annotation ann = AnnotationUtil.hasOwbInjectableResource(field.getDeclaredAnnotations());

                if (ann == null) continue;

                @SuppressWarnings("unchecked")
                ResourceReference<Object, ?> resourceRef = new ResourceReference(field.getDeclaringClass(), field.getName(), field.getType(), ann);
                boolean acess = field.isAccessible();
                try {
                    securityService.doPrivilegedSetAccessible(field, true);
                    field.set(managedBeanInstance, getResourceReference(resourceRef));
                } catch (Exception e) {
View Full Code Here

Examples of org.apache.wicket.ResourceReference

                        {
                            SiteTreeNode siteModel = (SiteTreeNode) ((DefaultMutableTreeNode) nodeModel
                                    .getObject()).getUserObject();
                            if (siteModel.getDocType() == SiteTreeNode.FileType.Folder)
                            {
                                return new ResourceReference(PortalTree.class,
                                        path + "/folder.gif");
                            } else if (siteModel.getDocType() == SiteTreeNode.FileType.Page)
                            {
                                return new ResourceReference(PortalTree.class,
                                        path + "/page.gif");
                            } else if (siteModel.getDocType() == SiteTreeNode.FileType.Link) { return new ResourceReference(
                                    PortalTree.class, path + "/link.gif"); }
                            return new ResourceReference(PortalTree.class, path
                                    + "/folder_closed.gif");
                        }
                    };
                }
            };
View Full Code Here

Examples of org.apache.wicket.ResourceReference

       
        Fragment newFragment = new Fragment("new", NEW_FRAGMENT_ID, this);
        buildNew(newFragment);
        form.add(newFragment);
       
        form.add(new Image("add", new ResourceReference(EditorTemplate.class, "add.png")));

        WebMarkupContainer footer = new WebMarkupContainer("footer");
        Button saveButton = saveButton("save");
        saveButton.setDefaultModel(new ResourceModel("pam.details.action.save"));
        footer.add(saveButton);
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.