org.apache.felix.scr.annotations.Reference.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(8.9k)|赞(0)|评价(0)|浏览(120)

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

Reference.<init>介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-roo

/**
 * {@link FilenameResolver} that delegates to {@link PathResolver}.
 * 
 * @author Ben Alex
 * @since 1.0
 */
@Component
@Service
public class PathResolvingAwareFilenameResolver implements FilenameResolver {

 @Reference
 private PathResolver pathResolver;

 public String getMeaningfulName(final File file) {
  Validate.notNull(file, "File required");
  return pathResolver.getFriendlyName(FileUtils.getCanonicalPath(file));
 }
}

代码示例来源:origin: spring-projects/spring-roo

@Component(componentAbstract = true)
@Reference(name = "identifierService", strategy = ReferenceStrategy.EVENT,
  policy = ReferencePolicy.DYNAMIC, referenceInterface = IdentifierService.class,
  cardinality = ReferenceCardinality.OPTIONAL_MULTIPLE)

代码示例来源:origin: org.apache.sling/org.apache.sling.resourceaccesssecurity

@Component
@Service(value=ResourceAccessSecurity.class)
@Property(name=ResourceAccessSecurity.CONTEXT, value=ResourceAccessSecurity.PROVIDER_CONTEXT)
@Reference(name="ResourceAccessGate", referenceInterface=ResourceAccessGate.class,
      cardinality=ReferenceCardinality.MANDATORY_MULTIPLE,
      policy=ReferencePolicy.DYNAMIC,
      target="(" + ResourceAccessGate.CONTEXT + "=" + ResourceAccessGate.PROVIDER_CONTEXT + ")")
public class ProviderResourceAccessSecurityImpl extends ResourceAccessSecurityImpl {

  public ProviderResourceAccessSecurityImpl() {
    super(false);
  }
}

代码示例来源:origin: org.apache.sling/org.apache.sling.resourceaccesssecurity

@Component
@Service(value=ResourceAccessSecurity.class)
@Property(name=ResourceAccessSecurity.CONTEXT, value=ResourceAccessSecurity.APPLICATION_CONTEXT)
@Reference(name="ResourceAccessGate", referenceInterface=ResourceAccessGate.class,
      cardinality=ReferenceCardinality.MANDATORY_MULTIPLE,
      policy=ReferencePolicy.DYNAMIC,
      target="(" + ResourceAccessGate.CONTEXT + "=" + ResourceAccessGate.APPLICATION_CONTEXT + ")")
public class ApplicationResourceAccessSecurityImpl extends ResourceAccessSecurityImpl {

  public ApplicationResourceAccessSecurityImpl() {
    super(false);
  }
}

代码示例来源:origin: spring-projects/spring-roo

/**
 * Commands for the 'backup' add-on to be used by the ROO shell.
 * 
 * @author Stefan Schmidt
 * @since 1.0
 */
@Component
@Service
public class BackupCommands implements CommandMarker {

 @Reference
 private BackupOperations backupOperations;

 @CliCommand(value = "backup",
   help = "Backups your project to a zip file located in root directory.")
 public String backup() {
  return backupOperations.backup();
 }

 @CliAvailabilityIndicator("backup")
 public boolean isBackupCommandAvailable() {
  return backupOperations.isBackupPossible();
 }
}

代码示例来源:origin: spring-projects/spring-roo

@Component(componentAbstract = true)
public abstract class AbstractOperations {
 @Reference(policy = ReferencePolicy.DYNAMIC)
 protected FileManager fileManager;

代码示例来源:origin: com.cognifide.cq/cqsm-bundle

@Component
@Service
@Properties({@Property(name = Constants.SERVICE_DESCRIPTION, value = "Resolves the instance type"),
    @Property(name = Constants.SERVICE_VENDOR, value = Cqsm.VENDOR_NAME)})
public class InstanceTypeProviderImpl implements InstanceTypeProvider {

  private static final String RUNMODE_AUTHOR = "author";

  @Reference
  private SlingSettingsService settingsService;

  @Override
  public boolean isOnAuthor() {
    return settingsService.getRunModes().contains(RUNMODE_AUTHOR);
  }

}

代码示例来源:origin: spring-projects/spring-roo

/**
 * Extends {@link PollingFileMonitorService} by making it available as an OSGi
 * component that automatically monitors the environment's
 * {@link FileEventListener} components.
 * 
 * @author Ben Alex
 * @since 1.1
 */
@Component
@Service
@Reference(name = "fileEventListener", strategy = ReferenceStrategy.EVENT,
  policy = ReferencePolicy.DYNAMIC, referenceInterface = FileEventListener.class,
  cardinality = ReferenceCardinality.OPTIONAL_MULTIPLE)
public class PollingFileMonitorComponent extends PollingFileMonitorService {

 protected void bindFileEventListener(final FileEventListener listener) {
  add(listener);
 }

 protected void unbindFileEventListener(final FileEventListener listener) {
  remove(listener);
 }
}

代码示例来源:origin: Cognifide/APM

@Component
@Service
@Properties({@Property(name = Constants.SERVICE_DESCRIPTION, value = "Resolves the instance type"),
    @Property(name = Constants.SERVICE_VENDOR, value = Cqsm.VENDOR_NAME)})
public class InstanceTypeProviderImpl implements InstanceTypeProvider {

  private static final String RUNMODE_AUTHOR = "author";

  @Reference
  private SlingSettingsService settingsService;

  @Override
  public boolean isOnAuthor() {
    return settingsService.getRunModes().contains(RUNMODE_AUTHOR);
  }

}

代码示例来源:origin: spring-projects/spring-roo

/**
 * Shell commands for hinting services.
 * 
 * @author Ben Alex
 * @since 1.0
 */
@Component
@Service
public class HintCommands implements CommandMarker {

 @Reference
 private HintOperations hintOperations;

 @CliCommand(value = "hint", help = "Provides step-by-step hints and context-sensitive guidance.")
 public String hint(
   @CliOption(
     key = {"topic", ""},
     mandatory = false,
     unspecifiedDefaultValue = "",
     optionContext = "disable-string-converter,topics",
     help = "The topic for which advice should be provided. "
       + "Possible values are: `controllers`, `eclipse`, `entities`, `fields`, `finders`, `general`, "
       + "`mvc`, `persistence`, `relationships`, `repositories`, `services`, `start` and `topics`.") final String topic) {

  return hintOperations.hint(topic);
 }
}

代码示例来源:origin: com.cognifide.cq/cqsm-bundle

@Component
@Service
@Properties({@Property(name = Constants.SERVICE_DESCRIPTION, value = "CQSM History Log Service"),
    @Property(name = Constants.SERVICE_VENDOR, value = Cqsm.VENDOR_NAME)})
public class HistoryLogListener implements EventListener {

  @Reference
  private ScriptManager scriptManager;

  @Reference
  private InstanceTypeProvider instanceTypeProvider;

  @Reference
  private History history;

  @Activate
  private void activate() {
    if (instanceTypeProvider.isOnAuthor()) {
      scriptManager.getEventManager().addListener(Event.AFTER_EXECUTE, this);
    }
  }

  @Override
  public void handle(Script script, Mode mode, Progress progress) {
    if (mode.isRun()) {
      history.log(script, mode, progress);
    }
  }
}

代码示例来源:origin: spring-projects/spring-roo

@Component
@Service
public class EqualsOperationsImpl implements EqualsOperations {
 @Reference
 private TypeLocationService typeLocationService;
 @Reference
 private TypeManagementService typeManagementService;

代码示例来源:origin: Cognifide/APM

@Component
@Service
@Properties({@Property(name = Constants.SERVICE_DESCRIPTION, value = "CQSM History Log Service"),
    @Property(name = Constants.SERVICE_VENDOR, value = Cqsm.VENDOR_NAME)})
public class HistoryLogListener implements EventListener {

  @Reference
  private ScriptManager scriptManager;

  @Reference
  private InstanceTypeProvider instanceTypeProvider;

  @Reference
  private History history;

  @Activate
  private void activate() {
    if (instanceTypeProvider.isOnAuthor()) {
      scriptManager.getEventManager().addListener(Event.AFTER_EXECUTE, this);
    }
  }

  @Override
  public void handle(Script script, Mode mode, Progress progress) {
    if (mode.isRun()) {
      history.log(script, mode, progress);
    }
  }
}

代码示例来源:origin: spring-projects/spring-roo

@Component
@Service
public class LogicalPathConverter implements Converter<LogicalPath> {
 @Reference
 ProjectOperations projectOperations;

代码示例来源:origin: org.apache.sling/org.apache.sling.launchpad.test-services

/**
 * Component which loads the JCR test content on startup.
 */
@Component(enabled=false, metatype=false)
@Properties({
  @Property(name="service.description", value="Test Content Loader"),
  @Property(name="service.vendor", value="The Apache Software Foundation")
})
public class StartupTestContentLoader {

  @Reference
  private TestContentLoader loader;

  protected void activate(ComponentContext context) throws RepositoryException, IOException {
    loader.loadTestContent();
  }
}

代码示例来源:origin: spring-projects/spring-roo

@Service
@Component
public class HintConverter implements Converter<String> {
 @Reference
 private HintOperations hintOperations;

代码示例来源:origin: com.adobe.acs/acs-aem-tools-bundle-livereload

@Component
@Service
@Properties({ @Property(name = EventConstants.EVENT_TOPIC,
    value = "com/adobe/granite/ui/librarymanager/INVALIDATED")
})
  @Reference
  private LiveReloadServer server;
  @Reference
  private HtmlLibraryManager htmlLibraryManager;

代码示例来源:origin: spring-projects/spring-roo

@Component
@Service
public class JLineShellComponent extends JLineShell {
 @Reference
 ExecutionStrategy executionStrategy;
 @Reference
 Parser parser;

代码示例来源:origin: Adobe-Consulting-Services/acs-aem-tools

@Component
@Service
@Properties({ @Property(name = EventConstants.EVENT_TOPIC,
    value = "com/adobe/granite/ui/librarymanager/INVALIDATED")
})
  @Reference
  private LiveReloadServer server;
  @Reference
  private HtmlLibraryManager htmlLibraryManager;

代码示例来源:origin: spring-projects/spring-roo

@Component
@Service
public class ObrAddOnBundleSymbolicNameConverter implements Converter<ObrAddOnBundleSymbolicName> {
 @Reference
 private ObrAddOnSearchOperations operations;

相关文章

微信公众号

最新文章

更多

Reference类方法