Package nexj.core.meta

Examples of nexj.core.meta.ClassAspect


    */
   public static void invoke(String sAspect, String sEvent, String sDescription,
      boolean bPreCommit, InvocationContext context)
   {
      Metadata metadata = context.getMetadata();
      ClassAspect aspect = metadata.findClassAspect(sAspect);

      if (aspect != null)
      {
         boolean bLogged = false;

View Full Code Here


         {
            Attribute attribute = m_metaclass.getInstanceAttribute(nAttribute);
  
            for (int nAspect = 0; nAspect < nAspectCount; ++nAspect)
            {
               ClassAspect aspect = (ClassAspect)m_metaclass.getAspect(nAspect);
               Attribute aspectAttribute = aspect.findAttribute(attribute.getName());

               if (aspectAttribute != null)
               {
                  PersistenceMapping aspectMapping = aspect.findPersistenceMapping(m_dataSource);

                  if (aspectMapping != null)
                  {
                     AttributeMapping aspectAttrMapping = aspectMapping.getAttributeMapping(aspectAttribute);

                     if (aspectAttrMapping != null)
                     {
                        deriveAttributeMapping(attribute, aspectAttribute, aspectAttrMapping);
                     }
                  }

                  break;
               }
            }
         }
      }

      completeDerivation();

      PersistenceMapping baseMapping = getBaseMapping();

      if (baseMapping != null)
      {
         if (m_typeCodeAttribute == null && baseMapping.m_typeCodeAttribute != null)
         {
            m_typeCodeAttribute = m_metaclass.getDerivedAttribute(baseMapping.m_typeCodeAttribute);
         }

         if (m_lockingAttribute == null && baseMapping.m_lockingAttribute != null)
         {
            m_lockingAttribute = m_metaclass.getDerivedAttribute(baseMapping.m_lockingAttribute);
         }

         if (m_fragmentAttribute == null && baseMapping.m_fragmentAttribute != null)
         {
            m_fragmentAttribute = m_metaclass.getDerivedAttribute(baseMapping.m_fragmentAttribute);
         }

         if (m_nFragmentReplication == REPLICATION_NONE)
         {
            m_nFragmentReplication = baseMapping.getFragmentReplication();
         }

         if (m_nCaching == CACHING_NONE)
         {
            m_nCaching = baseMapping.getCaching();
         }
      }

      if (nAspectCount != 0)
      {
         for (int nAspect = 0; nAspect < nAspectCount; ++nAspect)
         {
            ClassAspect aspect = (ClassAspect)m_metaclass.getAspect(nAspect);
            PersistenceMapping aspectMapping = aspect.findPersistenceMapping(m_dataSource);

            if (aspectMapping != null)
            {
               if (m_typeCodeAttribute == null && aspectMapping.getTypeCodeAttribute() != null)
               {
View Full Code Here

      if (m_bDerived)
      {
         for (int i = 0, nCount = m_metaclass.getAspectCount(); i < nCount; i++)
         {
            ClassAspect aspect = (ClassAspect)m_metaclass.getAspect(i);
            VirtualMapping mapping = (VirtualMapping)aspect.findPersistenceMapping(m_dataSource);

            if (mapping != null)
            {
               resolveScriptInheritance(mapping);
            }
View Full Code Here

    */
   protected void loadClassAspect(final Element aspectElement, final String sAspectName)
   {
      XMLMetadataHelper.verifyRootElement(aspectElement, "Aspect");

      final ClassAspect aspect = m_metadata.defineClassAspect(sAspectName, null);

      if (!aspect.isForward())
      {
         m_metadata.addClassAspect(aspect);
      }

      loadMetaclass(aspectElement, aspect);

      XMLMetadataLoader.parsePatterns(XMLUtil.getStringAttr(aspectElement, "pointcuts"),
         new XMLMetadataLoader.PatternHandler()
         {
            public void handlePattern(final String sPattern, final boolean bInclusive)
            {
               aspect.addPointcutPattern(sPattern, bInclusive);
            }
         });

      XMLUtil.withFirstChildElement(aspectElement, "PersistenceMappings", false, new ElementHandler()
      {
         public void handleElement(Element persistenceMappingsElement)
         {
            XMLUtil.forEachChildElement(persistenceMappingsElement, "PersistenceMapping", new ElementHandler()
            {
               public void handleElement(Element persistenceMappingElement)
               {
                  final String sResourceName = m_helper.getCurResourceName();
                  final Element clone = (Element)m_tmpDocument.importNode(persistenceMappingElement, true);

                  m_persistenceMappingLoadList.add(new ContextFixup(m_helper)
                  {
                     public void fixup()
                     {
                        int nCookie = m_helper.pushMarker(MetadataValidationException.RESOURCE_NAME, sResourceName);

                        try
                        {
                           aspect.addPersistenceMapping(loadPersistenceMapping(clone, aspect));
                        }
                        finally
                        {
                           m_helper.restoreMarker(nCookie);
                        }
View Full Code Here

   /**
    * @see nexj.core.meta.Metadata#defineClassAspect(java.lang.String, MetadataObject)
    */
   public ClassAspect defineClassAspect(String sName, MetadataObject referrer)
   {
      ClassAspect aspect = findClassAspect(sName);

      if (aspect == null)
      {
         aspect = new ClassAspect(sName);
         aspect.setForward(true);
         addClassAspect(aspect);
      }

      aspect.addReferrer(referrer);

      return aspect;
   }
View Full Code Here

    * @return The class aspect object.
    * @throws MetadataLookupException if the class aspect does not exist.
    */
   public ClassAspect getClassAspect(String sName)
   {
      ClassAspect classAspect = (ClassAspect)m_classAspectMap.get(sName);

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

TOP

Related Classes of nexj.core.meta.ClassAspect

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.