Package nexj.core.meta

Examples of nexj.core.meta.Component


      getWork(uow, FileWork.INSERT, instance);

      if (oid == null)
      {
         //Generate OID using key generator specified in metadata configuration
         Component component = fileMapping.getKeyGenerator();

         oid = ((OIDGenerator)component.getInstance(uow.getInvocationContext())).generateOID(instance, this);

         //OID must be a single value, converted to a string.
         Object[] oidValues = oid.getValueArray();

         if (oidValues.length != 1)
         {
            throw new PersistenceException("err.persistence.oidValueCount",
               new Object[]{component.getName(), Primitive.ONE_INTEGER,
                  Primitive.createInteger(oidValues.length)});
         }

         oidValues[0] = Primitive.toString(oidValues[0]);
         instance.setOID(oid);
View Full Code Here


         });
      }

      if (tcp.isSendable())
      {
         Component component = new Component("TCPSender." + channel.getName(), channel.getType().getSender(), Component.SINGLETON);

         loader.getMetadata().addComponent(component);
         loader.addSingletonFixup(component);
         tcp.setSender(component);
         component.addPrimitivePropertyInitializer("channel", channel);
      }

      if (tcp.isReceivable())
      {
         Component component = new Component("TCPReceiver." + channel.getName(), channel.getType().getReceiver(), Component.SINGLETON);

         tcp.setReceiver(component);
         component.setMetadata(loader.getMetadata());
         component.addPrimitivePropertyInitializer("channel", channel);
      }
   }
View Full Code Here

               final Attribute attribute = new Attribute(getAttributeName(column.getName(), metaclass));
               boolean bRequired = !column.isNullable() && column.getType() != Primitive.STRING;

               if (bRequired)
               {
                  Component component = column.getConverter();

                  if (component != null)
                  {
                     try
                     {
                        bRequired = (((Converter)component.getInstance(null)).getInverseFunction().invoke(null) == null);
                     }
                     catch (Throwable e)
                     {
                        // Still required if an error occurs
                     }
View Full Code Here

     
      fchan.resolve();
     
      if (fchan.isSendable())
      {
         Component component = new Component("FileSender." + channel.getName(), channel.getType().getSender(), Component.CONTEXT);
         Component connectionFactory = new Component("FileSenderConnectionFactory." + channel.getName(), FileConnectionFactory.class, Component.SINGLETON);
         Component factoryFactory = new Component("FileSenderConnectionFactoryFactory." + channel.getName(), FileSenderConnectionFactoryFactory.class, Component.NEW);
        
         factoryFactory.addPrimitivePropertyInitializer("channel", channel);
         connectionFactory.setFactory(factoryFactory, "create");
         component.addComponentPropertyInitializer("connectionFactory", connectionFactory);
         component.addPrimitivePropertyInitializer("channel", channel);
        
         fchan.setSender(component);
      }
     
      if (fchan.isReceivable())
      {
         Component component = new Component("FileReceiver." + channel.getName(), channel.getType().getReceiver(), Component.SINGLETON);

         loader.addSingletonFixup(component);
         fchan.setReceiver(component);
         component.setMetadata(loader.getMetadata());
         component.addPrimitivePropertyInitializer("channel", channel);

         final PrimitivePropertyInitializer initializer = component.addPrimitivePropertyInitializer("contextComponent", null);

         loader.addComponentFixup(new XMLMetadataHelper.ContextFixup(loader.getHelper())
         {
            public void fixup()
            {
View Full Code Here

   {
      if (value != null)
      {
         if (value instanceof Component)
         {
            Component c = (Component)value;

            if (c.getMetadata().findComponent(c.getName()) == null)
            {
               exportComponent(c);
            }
            else
            {
               m_writer.writeValue(c.getName());
            }
         }
         else
         {
            m_writer.writeValue(value.toString());
View Full Code Here

   {
      ObjectDispatchListener receiver = null;

      try
      {
         Component receiverComponent = Repository.getMetadata().getChannel(m_sChannelName).getReceiver();

         if (receiverComponent == null)
         {
            return;
         }

         receiver = (ObjectDispatchListener)receiverComponent.getInstance(null);
      }
      catch (IllegalStateException e)
      {
         if (s_logger.isDebugEnabled())
         {
View Full Code Here

         }
      }

      if (http.isEnabled())
      {
         Component component = new Component("HTTPAdapter." + channel.getName(),
            channel.getType().getSender(), Component.CONTEXT);
  
         http.setSender(component);
         http.setReceiver(component);
         component.setMetadata(loader.getMetadata());
         component.addPrimitivePropertyInitializer("channel", channel);
      }
   }
View Full Code Here

    * @return The component object.
    * @throws MetadataLookupException if the component does not exist.
    */
   public Component getComponent(String sName)
   {
      Component component = (Component)m_componentMap.get(sName);

      if (component != null)
      {
         return component;
      }
View Full Code Here

            context.getUnitOfWork().checkTransaction();

            if (channel.isSynchronous())
            {
               Component sender = channel.getSender();

               if (sender == null)
               {
                  throw new RPCException("err.rpc.notSender", new Object[]{channel.getName()});
               }

               Responder responder = (Responder)sender.getInstance(context);

               tobj = parse(responder.respond(format(tobj, (Sender)responder, context)), context);
            }
            else
            {
View Full Code Here

   /**
    * Invokes the persistence hook prepare method.
    */
   public void prepare()
   {
      Component hook = m_mapping.getHook();

      if (hook != null)
      {
         ((PersistenceHook)hook.getInstance(m_instance.getUnitOfWork().getInvocationContext())).prepare(this);
      }
   }
View Full Code Here

TOP

Related Classes of nexj.core.meta.Component

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.