org.apache.tapestry5.ioc.annotations.Local类的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(124)

本文整理了Java中org.apache.tapestry5.ioc.annotations.Local类的一些代码示例,展示了Local类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Local类的具体详情如下:
包路径:org.apache.tapestry5.ioc.annotations.Local
类名称:Local

Local介绍

暂无

代码示例

代码示例来源:origin: org.apache.tapestry/tapestry-beanvalidator

public static void contributeServiceOverride(
    MappedConfiguration<Class, Object> configuration,
    @Local FieldValidatorDefaultSource source)
{
  configuration.add(FieldValidatorDefaultSource.class, source);
}

代码示例来源:origin: apache/tapestry-5

/**
 * Contributes the default "session" strategy.
 */
public void contributeApplicationStatePersistenceStrategySource(
    MappedConfiguration<String, ApplicationStatePersistenceStrategy> configuration,
    @Local
    ApplicationStatePersistenceStrategy sessionStategy)
{
  configuration.add("session", sessionStategy);
}

代码示例来源:origin: apache/tapestry-5

public static void contributeServiceOverride(
    MappedConfiguration<Class<?>, Object> configuration,
    @Local FieldValidatorDefaultSource source)
{
  configuration.add(FieldValidatorDefaultSource.class, source);
}

代码示例来源:origin: net.sourceforge.tapestrytestify/tapestry-testify

public static void contributeMasterObjectProvider(OrderedConfiguration<ObjectProvider> configuration, @Local final CookieSinkSource cookies) {
    ObjectProvider provider = new ObjectProvider() {
      public <T> T provide(Class<T> objectType, AnnotationProvider annotationProvider, ObjectLocator locator) {
        if (objectType.equals(CookieSink.class) || objectType.equals(CookieSource.class)) {
          return objectType.cast(cookies);
        } else {
          return null;
        }
      }
    };

    configuration.add("TestifyProvider", provider, "before:ServiceOverride");
  }
}

代码示例来源:origin: apache/tapestry-5

public StringHolder buildLocalGreeterHolder(final @Local Greeter greeter)
  {
    return new StringHolder()
    {
      @Override
      public void setValue(String value)
      {
      }

      @Override
      public String getValue()
      {
        return greeter.getGreeting();
      }
    };
  }
}

代码示例来源:origin: org.apache.tapestry/tapestry-hibernate-core

/**
   * Adds the following configurers: <dl> <dt>Default <dd> performs default hibernate configuration <dt>PackageName
   * <dd> loads entities by package name</dl>
   */
  public static void contributeHibernateSessionSource(OrderedConfiguration<HibernateConfigurer> config,

                            @Local
                            HibernateConfigurer defaultHibernateConfigurer)
  {
    config.add("Default", defaultHibernateConfigurer);
    config.addInstance("PackageName", PackageNameHibernateConfigurer.class);
  }
}

代码示例来源:origin: apache/tapestry-5

/**
   * Adds the following configurers: <dl> <dt>Default <dd> performs default hibernate configuration <dt>PackageName
   * <dd> loads entities by package name</dl>
   */
  public static void contributeHibernateSessionSource(OrderedConfiguration<HibernateConfigurer> config,

                            @Local
                            HibernateConfigurer defaultHibernateConfigurer)
  {
    config.add("Default", defaultHibernateConfigurer);
    config.addInstance("PackageName", PackageNameHibernateConfigurer.class);
  }
}

代码示例来源:origin: apache/tapestry-5

public EntityManagerSourceImpl(Logger logger, @Symbol(JpaSymbols.PERSISTENCE_DESCRIPTOR)
final Resource persistenceDescriptor, @Local
PersistenceUnitConfigurer packageNamePersistenceUnitConfigurer,
                Map<String, PersistenceUnitConfigurer> configuration)
{
  this.logger = logger;
  List<TapestryPersistenceUnitInfo> persistenceUnitInfos = parsePersistenceUnitInfos(persistenceDescriptor);
  final Map<String, PersistenceUnitConfigurer> remainingConfigurations = configure(configuration, persistenceUnitInfos);
  configureRemaining(persistenceUnitInfos, remainingConfigurations);
  if (persistenceUnitInfos.size() == 1)
  {
    packageNamePersistenceUnitConfigurer.configure(persistenceUnitInfos.get(0));
  } else
  {
    validateUnitInfos(persistenceUnitInfos);
  }
  this.persistenceUnitInfos = persistenceUnitInfos;
}

代码示例来源:origin: org.apache.tapestry/tapestry-jpa

public EntityManagerSourceImpl(Logger logger, @Symbol(JpaSymbols.PERSISTENCE_DESCRIPTOR)
final Resource persistenceDescriptor, @Local
PersistenceUnitConfigurer packageNamePersistenceUnitConfigurer,
                Map<String, PersistenceUnitConfigurer> configuration)
{
  this.logger = logger;
  List<TapestryPersistenceUnitInfo> persistenceUnitInfos = parsePersistenceUnitInfos(persistenceDescriptor);
  final Map<String, PersistenceUnitConfigurer> remainingConfigurations = configure(configuration, persistenceUnitInfos);
  configureRemaining(persistenceUnitInfos, remainingConfigurations);
  if (persistenceUnitInfos.size() == 1)
  {
    packageNamePersistenceUnitConfigurer.configure(persistenceUnitInfos.get(0));
  } else
  {
    validateUnitInfos(persistenceUnitInfos);
  }
  this.persistenceUnitInfos = persistenceUnitInfos;
}

代码示例来源:origin: apache/tapestry-5

@Advise(serviceInterface = Greeter.class, id = "barney")
@Local
public static void localAdvise(MethodAdviceReceiver receiver)
{
  doAdvise(receiver, "delta");
}

代码示例来源:origin: apache/tapestry-5

@Decorate(serviceInterface = Greeter.class, id = "barney")
@Local
public static <T> T localAdvise(ServiceResources resources, T delegate, AspectDecorator aspectDecorator)
{
  return doDecorate("barney", resources, delegate, aspectDecorator);
}

代码示例来源:origin: apache/tapestry-5

@Contribute(ServiceOverride.class)
public static void setupTestableOverrides(MappedConfiguration<Class, Object> configuration, @Local
TestableRequest request, @Local
                     TestableResponse response, final ObjectLocator locator)
{
  configuration.add(Request.class, request);
  configuration.add(Response.class, response);
  TestableCookieSinkSource cookies = new TestableCookieSinkSource();
  configuration.add(CookieSink.class, cookies);
  configuration.add(CookieSource.class, cookies);
  // With the significant changes to the handling of assets in 5.4, we introduced a problem:
  // We were checking at page render time whether to generate URLs for normal or compressed
  // assets and that peeked at the HttpServletRequest global, which isn't set up by PageTester.
  // What we're doing here is using a hacked version of that code to force GZip support
  // on.
  configuration.add(ResponseCompressionAnalyzer.class, new ResponseCompressionAnalyzer()
  {
    public boolean isGZipEnabled(ContentType contentType)
    {
      return locator.getObject(CompressionAnalyzer.class, null).isCompressable(contentType.getMimeType());
    }
    public boolean isGZipSupported()
    {
      return true;
    }
  });
}

代码示例来源:origin: apache/tapestry-5

@Contribute(NameListHolder.class)
@BlueMarker
@Local
public void contributeXyz(OrderedConfiguration<String> configuration)
{
  configuration.add("Epsilon", "Epsilon", "after:*");
}

代码示例来源:origin: org.apache.tapestry/tapestry-ioc

public static void setupObjectProviders(OrderedConfiguration<ObjectProvider> configuration, @Local
final ServiceOverride serviceOverride)

代码示例来源:origin: apache/tapestry-5

public static void setupObjectProviders(OrderedConfiguration<ObjectProvider> configuration, @Local
final ServiceOverride serviceOverride)

相关文章