Examples of MappedAttribute


Examples of org.gatein.management.api.annotations.MappedAttribute

      Object[] params = new Object[parameterAnnotations.length];
      OperationAttachment attachment = null;
      for (int i = 0; i < parameterAnnotations.length; i++)
      {
         MappedPath pathTemplate;
         MappedAttribute managedAttribute;
         // Resolve path template and set as parameter to method
         if ((pathTemplate = getAnnotation(parameterAnnotations[i], MappedPath.class)) != null)
         {
            params[i] = operationContext.getAddress().resolvePathTemplate(pathTemplate.value());
            if (debug) log.debug("Resolved path template " + pathTemplate.value() + "=" + params[i]);
         }
         // Resolve attribute name and set as parameter to method
         else if ((managedAttribute = getAnnotation(parameterAnnotations[i], MappedAttribute.class)) != null)
         {
            if (List.class == method.getParameterTypes()[i])
            {
               params[i] = operationContext.getAttributes().getValues(managedAttribute.value());
            }
            else if (String.class == method.getParameterTypes()[i])
            {
               params[i] = operationContext.getAttributes().getValue(managedAttribute.value());
            }
            else
            {
               throw new RuntimeException("The parameter type " + method.getParameterTypes()[i] +
                  " cannot be annotated by @" + MappedAttribute.class.getName() + ". Only List<String> and String are allowed.");
            }

            if (debug) log.debug("Resolved attribute " + managedAttribute.value() + "=" + params[i]);
         }
         // Method wants something from the OperationContext, or the entire OperationContext object.
         else if ((getAnnotation(parameterAnnotations[i], ManagedContext.class)) != null)
         {
            Class<?> parameterType = method.getParameterTypes()[i];
View Full Code Here

Examples of org.glassfish.enterprise.ha.store.annotations.MappedAttribute

                            HashKey hashKeyAnn = m.getAnnotation(HashKey.class);
                            if (hashKeyAnn != null) {
                                attributeName = hashKeyAnn.name();
                                methodInfo.type = MethodInfo.MethodType.HASHKEY;
                            } else {
                                MappedAttribute mappedAttrAnn = m.getAnnotation(MappedAttribute.class);
                                if (mappedAttrAnn != null) {
                                    attributeName = mappedAttrAnn.mappedTo();
                                    methodInfo.type = MethodInfo.MethodType.MAPPED;
                                } else {
                                    //Some getter method
                                    continue;
                                }
View Full Code Here

Examples of org.hibernate.metamodel.source.annotations.attribute.MappedAttribute

  public Map<String, EmbeddableClass> getEmbeddedClasses() {
    return embeddedClasses;
  }

  public MappedAttribute getMappedAttribute(String propertyName) {
    MappedAttribute attribute;
    attribute = simpleAttributeMap.get( propertyName );
    if ( attribute == null ) {
      attribute = associationAttributeMap.get( propertyName );
    }
    if ( attribute == null ) {
View Full Code Here

Examples of org.hibernate.metamodel.source.annotations.attribute.MappedAttribute

    AnnotationInstance idAnnotation = JandexHelper.getSingleAnnotation(
        entityClass.getClassInfo(), JPADotNames.EMBEDDED_ID
    );

    String idName = JandexHelper.getPropertyName( idAnnotation.target() );
    MappedAttribute idAttribute = entityClass.getMappedAttribute( idName );
    if ( !( idAttribute instanceof SimpleAttribute ) ) {
      throw new AssertionFailure( "Unexpected attribute type for id attribute" );
    }

    SingularAttribute attribute = entityBinding.getEntity().getOrCreateComponentAttribute( idName );
View Full Code Here

Examples of org.hibernate.metamodel.source.annotations.attribute.MappedAttribute

          )
      );
    }

    // now that we have the id attribute we can create the attribute and binding
    MappedAttribute idAttribute = iter.next();
    Attribute attribute = container.getOrCreateSingularAttribute( idAttribute.getName() );

    SimpleAttributeBinding attributeBinding = entityBinding.makeSimpleIdAttributeBinding( attribute );
    attributeBinding.initialize( new AttributeBindingStateImpl( (SimpleAttribute) idAttribute ) );
    attributeBinding.initialize( new ColumnRelationalStateImpl( (SimpleAttribute) idAttribute, meta ) );
    bindSingleIdGeneratedValue( entityBinding, idAttribute.getName() );
  }
View Full Code Here

Examples of org.hibernate.metamodel.source.annotations.attribute.MappedAttribute

  public Map<String, EmbeddableClass> getEmbeddedClasses() {
    return embeddedClasses;
  }

  public MappedAttribute getMappedAttribute(String propertyName) {
    MappedAttribute attribute;
    attribute = simpleAttributeMap.get( propertyName );
    if ( attribute == null ) {
      attribute = associationAttributeMap.get( propertyName );
    }
    if ( attribute == null ) {
View Full Code Here

Examples of org.jboss.jmx.adaptor.snmp.config.attribute.MappedAttribute

       String oidPrefix = mmb.getOidPrefix();
       List attrs = mmb.getAttributes();
       Iterator aIt = attrs.iterator();
       while (aIt.hasNext())
       {
          MappedAttribute ma = (MappedAttribute)aIt.next();
          String oid;
          if (oidPrefix != null)
             oid = oidPrefix + ma.getOid();
          else
             oid = ma.getOid();
          
          BindEntry be = new BindEntry(oid, mmb.getName(), ma.getName());
          be.isReadWrite = ma.isReadWrite();
         
          ComparableSnmpObjectId coid = new ComparableSnmpObjectId(oid);
         
          if (log.isTraceEnabled())
             log.trace("New bind entry   " + be);
          if (bindings.containsKey(coid)) {
             log.info("Duplicate oid " + oid + SKIP_ENTRY);
             continue;
          }
          if (mmb.getName() == null || mmb.getName().equals(""))
          {
             log.info("Invalid mbean name for oid " + oid + SKIP_ENTRY);
             continue;
          }
          if (ma.getName() == null || ma.getName().equals(""))
          {
             log.info("Invalid attribute name " + ma.getName() + " for oid " + oid + SKIP_ENTRY);
             continue;
          }
          bindings.put(coid, be);
          oidKeys.add(coid);
         
View Full Code Here

Examples of org.jboss.jmx.adaptor.snmp.config.attribute.MappedAttribute

 
  public Object newChild(ManagedBean mbean, UnmarshallingContext navigator,
      String namespaceUri, String localName, Attributes attrs)
  {
   
    MappedAttribute attribute = null;
    if ("attribute".equals(localName)) {
      String oid = attrs.getValue("oid");
      String name = attrs.getValue("name");
      String mode = attrs.getValue("mode");
      attribute = new MappedAttribute();
      if ("rw".equalsIgnoreCase(mode))
            attribute.setReadWrite(true);
      attribute.setName(name);
      attribute.setOid(oid);
    }
    return attribute;
  }
View Full Code Here

Examples of org.jboss.jmx.adaptor.snmp.config.attribute.MappedAttribute

       String oidPrefix = mmb.getOidPrefix();
       List attrs = mmb.getAttributes();
       Iterator aIt = attrs.iterator();
       while (aIt.hasNext())
       {
          MappedAttribute ma = (MappedAttribute)aIt.next();
          String oid;
          if (oidPrefix != null)
             oid = oidPrefix + ma.getOid();
          else
             oid = ma.getOid();
          
          BindEntry be = new BindEntry(oid, mmb.getName(), ma.getName());
          be.isReadWrite = ma.isReadWrite();
         
          ComparableSnmpObjectId coid = new ComparableSnmpObjectId(oid);
         
          if (log.isTraceEnabled())
             log.trace("New bind entry   " + be);
          if (bindings.containsKey(coid)) {
             log.info("Duplicate oid " + oid + SKIP_ENTRY);
             continue;
          }
          if (mmb.getName() == null || mmb.getName().equals(""))
          {
             log.info("Invalid mbean name for oid " + oid + SKIP_ENTRY);
             continue;
          }
          if (ma.getName() == null || ma.getName().equals(""))
          {
             log.info("Invalid attribute name " + ma.getName() + " for oid " + oid + SKIP_ENTRY);
             continue;
          }
          bindings.put(coid, be);
          oidKeys.add(coid);
         
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.