Package org.jboss.resource.metadata

Examples of org.jboss.resource.metadata.ConfigPropertyMetaData


/*     */   {
/*  58 */     ResourceAdapter adapter = createResourceAdapter(ramd.getConnectorMetaData());
/*     */
/*  60 */     for (Iterator iter = ramd.getRaXmlMetaData().getProperties().iterator(); iter.hasNext(); )
/*     */     {
/*  62 */       ConfigPropertyMetaData cpmd = (ConfigPropertyMetaData)iter.next();
/*  63 */       applyProperty(cpmd, adapter.getClass(), adapter);
/*     */     }
/*     */
/*  67 */     return adapter;
/*     */   }
View Full Code Here


/*  86 */       throw new DeploymentException(raClass.getName() + " is not a resource adapter class");
/*  87 */     ResourceAdapter result = (ResourceAdapter)raClass.newInstance();
/*     */
/*  90 */     for (Iterator i = cmd.getProperties().iterator(); i.hasNext(); )
/*     */     {
/*  92 */       ConfigPropertyMetaData cpmd = (ConfigPropertyMetaData)i.next();
/*  93 */       applyProperty(cpmd, raClass, result);
/*     */     }
/*     */
/*  98 */     return result;
/*     */   }
View Full Code Here

/*     */     Iterator i;
/*  86 */     if ((raProperties != null) && (raProperties.size() != 0))
/*     */     {
/*  88 */       for (i = raProperties.iterator(); i.hasNext(); )
/*     */       {
/*  90 */         ConfigPropertyMetaData cpmd = (ConfigPropertyMetaData)i.next();
/*  91 */         String name = cpmd.getName();
/*  92 */         String value = cpmd.getValue();
/*  93 */         if ((value != null) && (value.length() > 0))
/*     */         {
/*  95 */           if (properties.containsKey(name))
/*     */           {
/*  97 */             if (trace) {
/*  98 */               log.trace("AdminObject '" + jndiName + "' property=" + name + " IGNORING value=" + value + " specified in MBean properties.");
/*     */             }
/*     */           }
/*     */           else
/*     */           {
/* 103 */             String typeName = cpmd.getType();
/* 104 */             if (trace)
/* 105 */               log.trace("AdminObject '" + jndiName + "' property=" + name + " loading class=" + typeName);
/* 106 */             Class type = cl.loadClass(typeName);
/*     */
/* 109 */             PropertyEditor editor = PropertyEditorManager.findEditor(type);
/* 110 */             if (editor == null)
/* 111 */               throw new DeploymentException("No property editor found for property '" + name + " class='" + type + "' for admin object '" + interfaceClass + "' ra=" + rarName);
/* 112 */             editor.setAsText(value);
/* 113 */             Object object = editor.getValue();
/*     */             try
/*     */             {
/* 117 */               String setter = "set" + Character.toUpperCase(name.charAt(0));
/* 118 */               if (name.length() > 1)
/* 119 */                 setter = setter.concat(name.substring(1));
/* 120 */               Method method = implClass.getMethod(setter, new Class[] { type });
/* 121 */               if (trace)
/* 122 */                 log.trace("AdminObject '" + jndiName + "' property=" + name + " set=" + object);
/* 123 */               method.invoke(result, new Object[] { object });
/*     */             }
/*     */             catch (InvocationTargetException e)
/*     */             {
/* 127 */               DeploymentException.rethrowAsDeploymentException("Error for property '" + name + "' class=" + implClass + "' for admin object '" + interfaceClass + "' ra=" + rarName, e.getTargetException());
/*     */             }
/*     */             catch (Throwable t)
/*     */             {
/* 131 */               DeploymentException.rethrowAsDeploymentException("Error for property '" + name + "' class=" + implClass + "' for admin object '" + interfaceClass + "' ra=" + rarName, t);
/*     */             }
/*     */           }
/*     */         }
/*     */       }
/*     */     }
/*     */     Iterator i;
/* 139 */     if (properties != null)
/*     */     {
/* 141 */       for (i = properties.entrySet().iterator(); i.hasNext(); )
/*     */       {
/* 143 */         Map.Entry property = (Map.Entry)i.next();
/* 144 */         String name = (String)property.getKey();
/* 145 */         String value = (String)property.getValue();
/* 146 */         if (trace) {
/* 147 */           log.trace("AdminObject '" + jndiName + "' property=" + name + " value=" + value);
/*     */         }
/*     */
/* 150 */         ConfigPropertyMetaData cpmd = aomd.getProperty(name);
/* 151 */         if (cpmd == null)
/* 152 */           throw new DeploymentException("No property '" + name + "' for admin object '" + interfaceClass + "' ra=" + rarName);
/* 153 */         if (trace) {
/* 154 */           log.trace("AdminObject '" + jndiName + "' property=" + name + " metadata=" + cpmd);
/*     */         }
/*     */
/* 157 */         String typeName = cpmd.getType();
/* 158 */         if (trace)
/* 159 */           log.trace("AdminObject '" + jndiName + "' property=" + name + " loading class=" + typeName);
/* 160 */         Class type = cl.loadClass(typeName);
/*     */
/* 163 */         PropertyEditor editor = PropertyEditorManager.findEditor(type);
View Full Code Here

/* 152 */     attrs[9] = new MBeanAttributeInfo("ReauthenticationSupport", Boolean.TYPE.getName(), "Whether reauthentication support is supported", true, false, false);
/* 153 */     attrs[10] = new MBeanAttributeInfo("ResourceAdapter", ResourceAdapter.class.getName(), "The resource adapter instance", true, false, false);
/* 154 */     int n = 11;
/* 155 */     for (Iterator i = properties.iterator(); i.hasNext(); )
/*     */     {
/* 157 */       ConfigPropertyMetaData cpmd = (ConfigPropertyMetaData)i.next();
/* 158 */       attrs[(n++)] = new MBeanAttributeInfo(cpmd.getName(), cpmd.getType(), cpmd.getDescription().getDescription(), true, false, false);
/*     */     }
/* 160 */     return attrs;
/*     */   }
View Full Code Here

/*    */
/*    */   public Object newChild(JBossRAMetaData ramd, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
/*    */   {
/* 65 */     if (localName.equals("ra-config-property"))
/*    */     {
/* 67 */       ConfigPropertyMetaData cpmd = new ConfigPropertyMetaData();
/* 68 */       ramd.addProperty(cpmd);
/* 69 */       return cpmd;
/*    */     }
/*    */
/* 74 */     return null;
View Full Code Here

/* 155 */     attrs[9] = new MBeanAttributeInfo("ReauthenticationSupport", Boolean.TYPE.getName(), "Whether reauthentication support is supported", true, false, false);
/* 156 */     attrs[10] = new MBeanAttributeInfo("ResourceAdapter", ResourceAdapter.class.getName(), "The resource adapter instance", true, false, false);
/* 157 */     int n = 11;
/* 158 */     for (Iterator i = properties.iterator(); i.hasNext(); )
/*     */     {
/* 160 */       ConfigPropertyMetaData cpmd = (ConfigPropertyMetaData)i.next();
/* 161 */       attrs[(n++)] = new MBeanAttributeInfo(cpmd.getName(), cpmd.getType(), cpmd.getDescription().getDescription(), true, false, false);
/*     */     }
/* 163 */     return attrs;
/*     */   }
View Full Code Here

/*     */   protected void setMcfProperties(Collection properties, boolean mustExist)
/*     */     throws DeploymentException
/*     */   {
/* 471 */     for (Iterator i = properties.iterator(); i.hasNext(); )
/*     */     {
/* 473 */       ConfigPropertyMetaData cpmd = (ConfigPropertyMetaData)i.next();
/* 474 */       String name = cpmd.getName();
/* 475 */       String type = cpmd.getType();
/* 476 */       String value = cpmd.getValue();
/* 477 */       if ((name == null) || (name.length() == 0) || (value == null) || (value.length() == 0))
/*     */       {
/* 479 */         this.log.debug("Not setting config property '" + name + "'");
/* 480 */         continue;
/*     */       }
View Full Code Here

/* 184 */     attrs[11] = new MBeanAttributeInfo("WorkManager", WorkManager.class.getName(), "The work manager", true, true, false);
/* 185 */     attrs[12] = new MBeanAttributeInfo("XATerminator", XATerminator.class.getName(), "The xa terminator", true, true, false);
/* 186 */     int n = 13;
/* 187 */     for (Iterator i = properties.iterator(); i.hasNext(); )
/*     */     {
/* 189 */       ConfigPropertyMetaData cpmd = (ConfigPropertyMetaData)i.next();
/* 190 */       attrs[(n++)] = new MBeanAttributeInfo(cpmd.getName(), cpmd.getType(), cpmd.getDescription().getDescription(), true, false, false);
/*     */     }
/* 192 */     return attrs;
/*     */   }
View Full Code Here

/*     */   protected void setMcfProperties(Collection properties, boolean mustExist)
/*     */     throws DeploymentException
/*     */   {
/* 446 */     for (Iterator i = properties.iterator(); i.hasNext(); )
/*     */     {
/* 448 */       ConfigPropertyMetaData cpmd = (ConfigPropertyMetaData)i.next();
/* 449 */       String name = cpmd.getName();
/* 450 */       String type = cpmd.getType();
/* 451 */       String value = cpmd.getValue();
/* 452 */       if ((name == null) || (name.length() == 0) || (value == null) || (value.length() == 0))
/*     */       {
/* 454 */         this.log.debug("Not setting config property '" + name + "'");
/* 455 */         continue;
/*     */       }
View Full Code Here

TOP

Related Classes of org.jboss.resource.metadata.ConfigPropertyMetaData

Copyright © 2018 www.massapicom. 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.