Package org.gatein.management.api.binding

Examples of org.gatein.management.api.binding.BindingProvider


public class SiteLayoutExportResource extends AbstractSiteOperationHandler
{
   @Override
   protected void execute(OperationContext operationContext, ResultHandler resultHandler, Site site) throws ResourceNotFoundException, OperationException
   {
      BindingProvider bindingProvider = operationContext.getBindingProvider();
      DataStorage dataStorage = operationContext.getRuntimeContext().getRuntimeComponent(DataStorage.class);

      SiteKey siteKey = getSiteKey(site);

      resultHandler.completed(new ExportResourceModel(new SiteLayoutExportTask(siteKey, dataStorage, bindingProvider.getMarshaller(PortalConfig.class, ContentType.XML))));
   }
View Full Code Here


   protected void execute(OperationContext operationContext, ResultHandler resultHandler, Page pages) throws ResourceNotFoundException, OperationException
   {
      SiteKey siteKey = getSiteKey(pages.getSite());

      DataStorage dataStorage = operationContext.getRuntimeContext().getRuntimeComponent(DataStorage.class);
      BindingProvider bindingProvider = operationContext.getBindingProvider();

      Collection<Page> pagesList = pages.getChildren();
      List<ExportTask> tasks = new ArrayList<ExportTask>(pagesList.size());

      PageExportTask pageExportTask =
         new PageExportTask(siteKey, dataStorage, bindingProvider.getMarshaller(
            org.exoplatform.portal.config.model.Page.PageSet.class, ContentType.XML));

      String pageName = operationContext.getAddress().resolvePathTemplate("page-name");
      for (Page page : pagesList)
      {
View Full Code Here

{
   private ConcurrentMap<String, BindingProvider> bindingProviders = new ConcurrentHashMap<String, BindingProvider>();

   public void register(String componentName, BindingProvider bindingProvider)
   {
      BindingProvider bp;
      if ( (bp = bindingProviders.putIfAbsent(componentName, bindingProvider)) != null)
      {
         throw new ManagementException("Binding provider " + bp + " already registered for component " + componentName);
      }
   }
View Full Code Here

   }

   @Override
   public BindingProvider getBindingProvider(final String componentName)
   {
      return new BindingProvider()
      {
         @Override
         public <T> Marshaller<T> getMarshaller(Class<T> type, ContentType contentType) throws BindingException
         {
            Marshaller<T> marshaller = null;
            BindingProvider bp = providers.getBindingProvider(componentName);
            if (bp != null)
            {
               marshaller = bp.getMarshaller(type, contentType);
               if (marshaller != null) return marshaller;
            }

            return globalBindingProvider.getMarshaller(type, contentType);
         }
View Full Code Here

      OperationHandler operationHandler = root.getOperationHandler(address, operationName);
      if (operationHandler != null)
      {
         // Obtain binding provider given managed component.
         String componentName = (address.size() >= 1) ? address.get(0) : null;
         BindingProvider bindingProvider = managementService.getBindingProvider(componentName);

         // ModelProvider to use for de-typed models
         ModelProvider modelProvider = DmrModelProvider.INSTANCE;

         // Execute operation for given registered operation handler
View Full Code Here

TOP

Related Classes of org.gatein.management.api.binding.BindingProvider

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.