Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  // Copyright 2004, 2005 The Apache Software Foundation
  //
  // Licensed under the Apache License, Version 2.0 (the "License");
  // you may not use this file except in compliance with the License.
  // You may obtain a copy of the License at
  //
  //     http://www.apache.org/licenses/LICENSE-2.0
  //
  // Unless required by applicable law or agreed to in writing, software
 // distributed under the License is distributed on an "AS IS" BASIS,
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
 package org.apache.tapestry.services.impl;
 
 import  org.apache.hivemind.ApplicationRuntimeException;
 import  org.apache.hivemind.ClassResolver;
 import  org.apache.hivemind.service.ClassFactory;
 import  org.apache.hivemind.util.Defense;
 
 import java.util.Map;

Implementation of the org.apache.tapestry.services.ComponentConstructorFactory service interface.

Author(s):
Howard M. Lewis Ship
Since:
4.0
 
                                                         ResetEventListenerReportStatusListener
 {
     private final ReentrantLock _lock = new ReentrantLock();
 
     private String _serviceId;
 
     private Log _log;
 
     private ClassFactory _classFactory;
 
     private ClassResolver _classResolver;
 
 
     private EnhancementWorker _chain;

    
Map of org.apache.tapestry.services.ComponentConstructor keyed on org.apache.tapestry.spec.IComponentSpecification.
 
 
     private Map _cachedConstructors = Collections.synchronizedMap(new HashMap());
 
     public void resetEventDidOccur()
     {
         .clear();
     }
 
     public synchronized void reportStatus(ReportStatusEvent event)
     {
         event.title();
 
         event.property("enhanced class count".size());
         event.collection("enhanced classes".keySet());
     }
 
                                                         String className)
     {
         Defense.notNull(specification"specification");
 
         try
         {
             .lockInterruptibly();
 
             ComponentConstructor result = (ComponentConstructor.get(specification);
 
             if (result == null)
             {
                 Class baseClass = .findClass(className);
 
                 EnhancementOperationImpl eo = new EnhancementOperationImpl(specificationbaseClass);
 
                 // Invoking on the chain is the same as invoking on every
                 // object in the chain (because method performEnhancement() is type void).
                .performEnhancement(eospecification);
                result = eo.getConstructor();
                // TODO: This should be optional to work around that IBM JVM bug.
                .validate(baseClassresult.getComponentClass(), specification);
                .put(specificationresult);
            }
            return result;
        } catch (InterruptedException e)
        {
            throw new ApplicationRuntimeException(e);
        } finally
        {
            .unlock();
        }
    }
    public void setClassFactory(ClassFactory classFactory)
    {
         = classFactory;
    }
    public void setClassResolver(ClassResolver classResolver)
    {
         = classResolver;
    }
    public void setValidator(EnhancedClassValidator validator)
    {
         = validator;
    }
    public void setChain(EnhancementWorker chain)
    {
         = chain;
    }
    public void setLog(Log log)
    {
         = log;
    }
    public void setServiceId(String serviceId)
    {
         = serviceId;
    }
New to GrepCode? Check out our FAQ X