Package org.apache.nutch.plugin

Examples of org.apache.nutch.plugin.ExtensionPoint


    if (this.responseWriters == null) {

      try {

        // get the extension point and all ResponseWriter extensions
        ExtensionPoint point = PluginRepository.get(conf).getExtensionPoint(
          ResponseWriter.X_POINT_ID);
        if (point == null) {
          throw new RuntimeException(ResponseWriter.X_POINT_ID + " not found.");
        }

        // populate content type on the ResponseWriter classes, each response
        // writer can handle more than one response type
        Extension[] extensions = point.getExtensions();
        Map<String, ResponseWriter> writers = new HashMap<String, ResponseWriter>();
        for (int i = 0; i < extensions.length; i++) {
          Extension extension = extensions[i];
          ResponseWriter writer = (ResponseWriter)extension.getExtensionInstance();
          String[] responseTypes = extension.getAttribute("responseType").split(
View Full Code Here


        orderedFilters = order.split("\\s+");
      }
      try {

        // get the field filter extension point
        ExtensionPoint point = PluginRepository.get(conf).getExtensionPoint(
          FieldFilter.X_POINT_ID);
        if (point == null) {
          throw new RuntimeException(FieldFilter.X_POINT_ID + " not found.");
        }
       
        // get all of the field filter plugins
        Extension[] extensions = point.getExtensions();
        HashMap<String, FieldFilter> filterMap = new HashMap<String, FieldFilter>();
        for (int i = 0; i < extensions.length; i++) {
          Extension extension = extensions[i];
          FieldFilter filter = (FieldFilter)extension.getExtensionInstance();
          LOG.info("Adding " + filter.getClass().getName());
View Full Code Here

      String[] orderedFilters = null;
      if (order != null && !order.trim().equals("")) {
        orderedFilters = order.split("\\s+");
      }
      try {
        ExtensionPoint point = PluginRepository.get(conf).getExtensionPoint(
            IndexingFilter.X_POINT_ID);
        if (point == null)
          throw new RuntimeException(IndexingFilter.X_POINT_ID + " not found.");
        Extension[] extensions = point.getExtensions();
        HashMap<String, IndexingFilter> filterMap =
          new HashMap<String, IndexingFilter>();
        for (int i = 0; i < extensions.length; i++) {
          Extension extension = extensions[i];
          IndexingFilter filter = (IndexingFilter) extension
View Full Code Here

  protected Collection setup(String xPoint, Configuration conf) {
    LOG.info("setting up:" + xPoint);

    HashMap filters = new HashMap();
    try {
      ExtensionPoint point = serviceLocator.getPluginRepository()
          .getExtensionPoint(xPoint);
      if (point != null) {
        Extension[] extensions = point.getExtensions();
        for (int i = 0; i < extensions.length; i++) {
          Extension extension = extensions[i];
          Object extensionInstance = extension.getExtensionInstance();
          if (!filters.containsKey(extensionInstance.getClass().getName())) {
            filters.put(extensionInstance.getClass().getName(),
View Full Code Here

    if (LOG.isDebugEnabled()) {
      LOG.debug("PluginResourceLoader : dynamically setting jars based "
          + "on plugins implementing UIExtensionPoint.");
    }

    ExtensionPoint point = locator.getPluginRepository().getExtensionPoint(
        UIExtensionPoint.X_POINT_ID);

    if (point == null) {
      LOG.info("Can't find extension point '" + UIExtensionPoint.X_POINT_ID
          + "'");
      classloaders.add(parent);
      return;
    }

    Extension[] extensions = point.getExtensions();

    for (int i = 0; i < extensions.length; i++) {
      Extension extension = extensions[i];

      PluginClassLoader loader = extension.getDescriptor().getClassLoader();
View Full Code Here

    super.init(conf);

    // TODO should perhaps first try handle core definitions

    // process extensions
    ExtensionPoint point = getServiceLocator().getPluginRepository()
        .getExtensionPoint(UIExtensionPoint.X_POINT_ID);

    if (point != null) {

      Extension[] extensions = point.getExtensions();

      for (int i = 0; i < extensions.length; i++) {
        Extension extension = extensions[i];

        WebAppModule module = new WebAppModule(extension.getDescriptor()
View Full Code Here

    }

    //
    // plugged implementations can override defaults if they wish
    //
    ExtensionPoint point = ServletContextServiceLocator.getInstance(
        servletContext).getPluginRepository().getExtensionPoint(
        UIExtensionPoint.X_POINT_ID);

    if (point != null) {

      Extension[] extensions = point.getExtensions();

      LOG.info("There are " + extensions.length
          + " extensions available for UI");

      for (int i = 0; i < extensions.length; i++) {
View Full Code Here

      if (order != null && !order.trim().equals("")) {
        orderedFilters = order.split("\\s+");
      }

      try {
        ExtensionPoint point = PluginRepository.get(conf).getExtensionPoint(
            URLFilter.X_POINT_ID);
        if (point == null)
          throw new RuntimeException(URLFilter.X_POINT_ID + " not found.");
        Extension[] extensions = point.getExtensions();
        HashMap filterMap = new HashMap();
        for (int i = 0; i < extensions.length; i++) {
          Extension extension = extensions[i];
          URLFilter filter = (URLFilter) extension.getExtensionInstance();
          if (!filterMap.containsKey(filter.getClass().getName())) {
View Full Code Here

  private static final Logger LOG = LoggerFactory.getLogger(SegmentMergeFilters.class);
  private SegmentMergeFilter[] filters;

  public SegmentMergeFilters(Configuration conf) {
    try {
      ExtensionPoint point = PluginRepository.get(conf).getExtensionPoint(
          SegmentMergeFilter.X_POINT_ID);
      if (point == null)
        throw new RuntimeException(URLFilter.X_POINT_ID + " not found.");
      Extension[] extensions = point.getExtensions();
      filters = new SegmentMergeFilter[extensions.length];
      for (int i = 0; i < extensions.length; i++) {
        filters[i] = (SegmentMergeFilter) extensions[i].getExtensionInstance();
      }
    } catch (PluginRuntimeException e) {
View Full Code Here

    synchronized (objectCache) {
      this.indexWriters = (IndexWriter[]) objectCache
          .getObject(IndexWriter.class.getName());
      if (this.indexWriters == null) {
        try {
          ExtensionPoint point = PluginRepository.get(conf)
              .getExtensionPoint(IndexWriter.X_POINT_ID);
          if (point == null)
            throw new RuntimeException(IndexWriter.X_POINT_ID
                + " not found.");
          Extension[] extensions = point.getExtensions();
          HashMap<String, IndexWriter> indexerMap = new HashMap<String, IndexWriter>();
          for (int i = 0; i < extensions.length; i++) {
            Extension extension = extensions[i];
            IndexWriter writer = (IndexWriter) extension
                .getExtensionInstance();
View Full Code Here

TOP

Related Classes of org.apache.nutch.plugin.ExtensionPoint

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.