org.qi4j.api.injection.scope.This.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(198)

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

This.<init>介绍

暂无

代码示例

代码示例来源:origin: org.qi4j.core/org.qi4j.core.testsupport

public static abstract class AnotherValueMixin
  implements AnotherValue
{
  @This
  private AnotherValueInternalState internalState;
  @Override
  public String internalVal()
  {
    return internalState.val2().get();
  }
}

代码示例来源:origin: org.qi4j.library/org.qi4j.library.logging

public TraceConcern( @This Composite thisComposite )
{
  super( thisComposite );
}

代码示例来源:origin: org.qi4j.library/org.qi4j.library.logging

public TraceAllConcern( @This Composite composite )
{
  super( composite );
}

代码示例来源:origin: org.codeartisans.qipki/qipki-ca

public class X509Mixin
    implements X509Behavior
{

  @This
  private X509 state;

  @Override
  public X509Certificate x509Certificate()
  {
    try {
      return ( X509Certificate ) new PEMReader( new StringReader( state.pem().get() ) ).readObject();
    } catch ( IOException ex ) {
      throw new QiPkiFailure( "Unable to read X509 pem", ex );
    }
  }

}

代码示例来源:origin: org.qi4j.core/org.qi4j.core.testsupport

public static class MyServiceMixin
  implements MyService
{
  @This
  private Configuration<ConfigSerializationConfig> config;
  @Override
  public String hostIp()
  {
    return config.get().host().get().ip().get();
  }
  @Override
  public Integer hostPort()
  {
    return config.get().host().get().port().get();
  }
  @Override
  public String name()
  {
    return config.get().name().get();
  }
}

代码示例来源:origin: org.codeartisans.qipki/org.qi4j.library.uowfile

class Mixin
    implements Lifecycle
{
  @This
  private HasUoWFile hasUoWFile;
  @Override
  public void create()
      throws LifecycleException
  {
    // NOOP
  }
  @Override
  public void remove()
      throws LifecycleException
  {
    // We use the managed file so that if the UoW gets discarded the file will be restored
    File file = hasUoWFile.managedFile();
    if ( file.exists() && !file.delete() ) {
      throw new LifecycleException( "Unable to delete existing file: " + file );
    }
  }
}

代码示例来源:origin: org.qi4j.library/org.qi4j.library.http

public class JettyMixin
    extends AbstractJettyMixin
{

  @This
  private Configuration<JettyConfiguration> configuration;

  public JettyMixin( @This Identity meAsIdentity,
            @Service Server jettyServer,
            @Service Iterable<ServiceReference<ServletContextListener>> contextListeners,
            @Service Iterable<ServiceReference<Servlet>> servlets,
            @Service Iterable<ServiceReference<Filter>> filters,
            @Optional @Service MBeanServer mBeanServer )
  {
    super( meAsIdentity.identity().get(), jettyServer, contextListeners, servlets, filters, mBeanServer );
  }

  @Override
  protected JettyConfiguration configuration()
  {
    return configuration.get();
  }

  @Override
  protected Protocol servedProtocol()
  {
    return Protocol.http;
  }

}

代码示例来源:origin: org.codeartisans.swing-on-steroids/sos-core

abstract class Mixin
    implements WorkQueueComposite
{
  @This
  private Configuration<WorkQueueConfiguration> config;
  private DefaultWorkQueue delegate;
  @Override
  public void enqueue( Runnable runnable )
  {
    ensureDelegate().enqueue( runnable );
  }
  @Override
  public void enqueue( Runnable runnable, ErrorCallbackAdapter<RuntimeException> errorCallback )
  {
    ensureDelegate().enqueue( runnable, errorCallback );
  }
  private WorkQueue ensureDelegate()
  {
    if ( delegate == null ) {
      WorkQueueConfiguration cfg = config.configuration();
      delegate = new DefaultWorkQueue( cfg.name().get(), cfg.size().get() );
    }
    return delegate;
  }
}

代码示例来源:origin: org.codeartisans.qipki/org.qi4j.library.uowfile

public class Mixin
    implements Lifecycle
{
  @This
  private HasUoWFiles<?> hasUoWFiles;
  @Override
  public void create()
      throws LifecycleException
  {
    // NOOP
  }
  @Override
  public void remove()
      throws LifecycleException
  {
    // We use the managed files so that if the UoW gets discarded the files will be restored
    List<File> errors = new ArrayList<File>();
    for ( File eachFile : hasUoWFiles.managedFiles() ) {
      if ( eachFile.exists() ) {
        if ( !eachFile.delete() ) {
          errors.add( eachFile );
        }
      }
    }
    if ( !errors.isEmpty() ) {
      throw new LifecycleException( "Unable to delete existing files: " + errors );
    }
  }
}

代码示例来源:origin: org.codeartisans.qipki/qipki-ca

static abstract class Mixin
    implements CRL, UoWFileLocator
{
  @Service
  private CRLFileService crlFileService;
  @This
  private CRL me;
  @Override
  public File locateAttachedFile()
  {
    return crlFileService.getCRLFile( me );
  }
}

代码示例来源:origin: org.qi4j.library/org.qi4j.library.scheduler

protected ThreadFactory( @This SchedulerService me )
{
  SecurityManager sm = System.getSecurityManager();
  group = ( sm != null ) ? sm.getThreadGroup() : Thread.currentThread().getThreadGroup();
  namePrefix = me.identity().get() + "-P" + POOL_NUMBER.getAndIncrement() + "W";
}

代码示例来源:origin: org.codeartisans.qipki/org.qi4j.library.uowfile

class Mixin
    implements HasUoWFile
{
  @Service
  private UoWFileFactory uowFileFactory;
  @This
  private UoWFileLocator locator;
  @Override
  public File attachedFile()
  {
    return locator.locateAttachedFile();
  }
  @Override
  public File managedFile()
  {
    return uowFileFactory.createCurrentUoWFile( locator.locateAttachedFile() ).asFile();
  }
}

代码示例来源:origin: org.codeartisans.qipki/qipki-ca-http

@This
@Optional
private Configuration<RestApiConfiguration> config;

代码示例来源:origin: org.qi4j.library/org.qi4j.library.logging

public SimpleLogConcern( @This Composite composite )
{
  this.composite = composite;
  Class<?> type = first( Qi4j.FUNCTION_DESCRIPTOR_FOR.map( composite ).types() );
  category = type.getName();
}

代码示例来源:origin: org.codeartisans.qipki/qipki-ca

public abstract class EscrowedKeyPairMixin
    implements EscrowedKeyPairBehavior, UoWFileLocator
{

  @This
  private EscrowedKeyPair me;
  @Service
  private EscrowedKeyPairFileService fileService;
  @Service
  private CryptIO cryptio;

  @Override
  public File locateAttachedFile()
  {
    return fileService.getEscrowedKeyPairFile( me );
  }

  @Override
  public KeyPair keyPair()
  {
    try {
      return cryptio.readKeyPairPEM( new FileReader( me.managedFile() ) );
    } catch ( FileNotFoundException ex ) {
      throw new IllegalStateException( ex.getMessage(), ex );
    }
  }

}

代码示例来源:origin: org.qi4j.library/org.qi4j.library.eventsourcing

extends GenericConcern
@This
private EntityComposite entity;

代码示例来源:origin: org.qi4j.library/org.qi4j.library.shiro-web

@This
private Configuration<ShiroIniConfiguration> configuration;

代码示例来源:origin: org.qi4j.library/org.qi4j.library.rdf

public HttpRepositoryMixin( @This Configuration<HttpRepositoryConfiguration> configuration )
{
  super( getRepositoryUrl( configuration.get() ), getRepositoryId( configuration.get() ) );
}

代码示例来源:origin: org.qi4j.library/org.qi4j.library.http

public SecureJettyMixin( @This Identity meAsIdentity,
             @Service Server jettyServer,
             @Service Iterable<ServiceReference<ServletContextListener>> contextListeners,
             @Service Iterable<ServiceReference<Servlet>> servlets,
             @Service Iterable<ServiceReference<Filter>> filters,
             @Optional @Service MBeanServer mBeanServer )
{
  super( meAsIdentity.identity().get(), jettyServer, contextListeners, servlets, filters, mBeanServer );
}

代码示例来源:origin: org.qi4j.library/org.qi4j.library.http

public JettyMixin( @This Identity meAsIdentity,
          @Service Server jettyServer,
          @Service Iterable<ServiceReference<ServletContextListener>> contextListeners,
          @Service Iterable<ServiceReference<Servlet>> servlets,
          @Service Iterable<ServiceReference<Filter>> filters,
          @Optional @Service MBeanServer mBeanServer )
{
  super( meAsIdentity.identity().get(), jettyServer, contextListeners, servlets, filters, mBeanServer );
}

相关文章