You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hop.apache.org by ha...@apache.org on 2020/11/25 11:59:52 UTC
[incubator-hop] branch master updated: HOP-2200 : Remove lifecycle
plugin type
This is an automated email from the ASF dual-hosted git repository.
hansva pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-hop.git
The following commit(s) were added to refs/heads/master by this push:
new c3cbc6b HOP-2200 : Remove lifecycle plugin type
new d1fb8d9 Merge pull request #415 from mattcasters/master
c3cbc6b is described below
commit c3cbc6b9efe913921e1b2cfc6ca7305b3e7d9e27
Author: Matt Casters <ma...@gmail.com>
AuthorDate: Wed Nov 25 11:55:03 2020 +0100
HOP-2200 : Remove lifecycle plugin type
---
.../hop/core/lifecycle/IHopLifecycleListener.java | 41 ------
.../hop/core/lifecycle/ILifeEventHandler.java | 27 ----
.../hop/core/lifecycle/ILifecycleListener.java | 49 -------
.../apache/hop/core/lifecycle/LifeEventInfo.java | 82 ------------
.../hop/core/lifecycle/LifecycleException.java | 76 -----------
.../hop/core/lifecycle/LifeEventInfoTest.java | 75 -----------
.../hop/core/lifecycle/LifecycleExceptionTest.java | 70 ----------
.../java/org/apache/hop/core/HopEnvironment.java | 25 ++--
.../hop/core/annotations/HopLifecyclePlugin.java | 49 -------
.../hop/core/annotations/LifecyclePlugin.java | 40 ------
.../hop/core/plugins/HopLifecyclePluginType.java | 142 ---------------------
.../metainject/OpenMappingExtension.java | 63 ---------
.../metainject/OpenMappingExtensionTest.java | 80 ------------
13 files changed, 9 insertions(+), 810 deletions(-)
diff --git a/core/src/main/java/org/apache/hop/core/lifecycle/IHopLifecycleListener.java b/core/src/main/java/org/apache/hop/core/lifecycle/IHopLifecycleListener.java
deleted file mode 100644
index 7913e13..0000000
--- a/core/src/main/java/org/apache/hop/core/lifecycle/IHopLifecycleListener.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*! ******************************************************************************
- *
- * Hop : The Hop Orchestration Platform
- *
- * Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com
- *
- *******************************************************************************
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************************/
-
-package org.apache.hop.core.lifecycle;
-
-/**
- * A callback to be notified when the Hop environment is initialized and shut down.
- */
-public interface IHopLifecycleListener {
- /**
- * Called during HopEnvironment initialization.
- *
- * @throws LifecycleException to indicate the listener did not complete successfully. Severe {@link LifecycleException}s will stop the
- * initialization of the HopEnvironment.
- */
- void onEnvironmentInit() throws org.apache.hop.core.lifecycle.LifecycleException;
-
- /**
- * Called when the VM that initialized HopEnvironment terminates.
- */
- void onEnvironmentShutdown();
-}
diff --git a/core/src/main/java/org/apache/hop/core/lifecycle/ILifeEventHandler.java b/core/src/main/java/org/apache/hop/core/lifecycle/ILifeEventHandler.java
deleted file mode 100644
index b3c8f8f..0000000
--- a/core/src/main/java/org/apache/hop/core/lifecycle/ILifeEventHandler.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*! ******************************************************************************
- *
- * Hop : The Hop Orchestration Platform
- *
- * Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com
- *
- *******************************************************************************
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************************/
-
-package org.apache.hop.core.lifecycle;
-
-public interface ILifeEventHandler {
- void consume( LifeEventInfo info );
-}
diff --git a/core/src/main/java/org/apache/hop/core/lifecycle/ILifecycleListener.java b/core/src/main/java/org/apache/hop/core/lifecycle/ILifecycleListener.java
deleted file mode 100644
index b2739ba..0000000
--- a/core/src/main/java/org/apache/hop/core/lifecycle/ILifecycleListener.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*! ******************************************************************************
- *
- * Hop : The Hop Orchestration Platform
- *
- * Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com
- *
- *******************************************************************************
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************************/
-
-package org.apache.hop.core.lifecycle;
-
-/**
- * A callback interface that listens to specific lifecycle events triggered when HopGui starts and stops.
- * <p>
- * Listeners are loaded dynamically by PDI. In order to register a listener with HopGui, a class that implements this
- * interface must be placed in the "org.apache.hop.core.listeners.pdi" package, and it will be loaded automatically when
- * HopGui starts.
- *
- * @author Alex Silva
- */
-public interface ILifecycleListener {
- /**
- * Called when the application starts.
- *
- * @throws LifecycleException Whenever this listener is unable to start succesfully.
- */
- public void onStart( ILifeEventHandler handler ) throws LifecycleException;
-
- /**
- * Called when the application ends
- *
- * @throws LifecycleException If a problem prevents this listener from shutting down.
- */
- public void onExit( ILifeEventHandler handler ) throws LifecycleException;
-
-}
diff --git a/core/src/main/java/org/apache/hop/core/lifecycle/LifeEventInfo.java b/core/src/main/java/org/apache/hop/core/lifecycle/LifeEventInfo.java
deleted file mode 100644
index a27d814..0000000
--- a/core/src/main/java/org/apache/hop/core/lifecycle/LifeEventInfo.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*! ******************************************************************************
- *
- * Hop : The Hop Orchestration Platform
- *
- * Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com
- *
- *******************************************************************************
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************************/
-
-package org.apache.hop.core.lifecycle;
-
-import java.util.HashSet;
-import java.util.Set;
-
-public class LifeEventInfo {
- public enum Hint {
- DISPLAY_MSG_BOX, DISPLAY_BROWSER;
- }
-
- public enum State {
- SUCCESS, FAIL, HALTED;
- }
-
- private String message;
-
- private String name;
-
- private Set<Hint> hints = new HashSet<Hint>();
-
- private State state;
-
- public void setHint( Hint hint ) {
- hints.add( hint );
- }
-
- public String getMessage() {
- return message;
- }
-
- public void setMessage( String message ) {
- this.message = message;
- }
-
- public boolean hasHint( Hint h ) {
- for ( Hint hint : hints ) {
- if ( hint == h ) {
- return true;
- }
- }
-
- return false;
- }
-
- public State getState() {
- return state;
- }
-
- public void setState( State state ) {
- this.state = state;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName( String name ) {
- this.name = name;
- }
-}
diff --git a/core/src/main/java/org/apache/hop/core/lifecycle/LifecycleException.java b/core/src/main/java/org/apache/hop/core/lifecycle/LifecycleException.java
deleted file mode 100644
index 50736d1..0000000
--- a/core/src/main/java/org/apache/hop/core/lifecycle/LifecycleException.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*! ******************************************************************************
- *
- * Hop : The Hop Orchestration Platform
- *
- * Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com
- *
- *******************************************************************************
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************************/
-
-package org.apache.hop.core.lifecycle;
-
-public class LifecycleException extends Exception {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * Indicates an error that prevents the application from starting succesfully.
- */
- private final boolean severe;
-
- /**
- * @param severe true if HopGui should quit because of this exception
- */
- public LifecycleException( boolean severe ) {
- this.severe = severe;
- }
-
- /**
- * @param message The (localized) message
- * @param severe true if HopGui should quit because of this exception
- */
- public LifecycleException( String message, boolean severe ) {
- super( message );
- this.severe = severe;
- }
-
- /**
- * @param cause
- * @param severe true if HopGui should quit because of this exception
- */
- public LifecycleException( Throwable cause, boolean severe ) {
- super( cause );
- this.severe = severe;
- }
-
- /**
- * @param message
- * @param cause
- * @param severe true if HopGui should quit because of this exception
- */
- public LifecycleException( String message, Throwable cause, boolean severe ) {
- super( message, cause );
- this.severe = severe;
- }
-
- /**
- * @return true if HopGui should quit because of this exception
- */
- public boolean isSevere() {
- return severe;
- }
-
-}
diff --git a/core/src/test/java/org/apache/hop/core/lifecycle/LifeEventInfoTest.java b/core/src/test/java/org/apache/hop/core/lifecycle/LifeEventInfoTest.java
deleted file mode 100644
index 76c6b90..0000000
--- a/core/src/test/java/org/apache/hop/core/lifecycle/LifeEventInfoTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*! ******************************************************************************
- *
- * Hop : The Hop Orchestration Platform
- *
- * Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com
- *
- *******************************************************************************
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************************/
-package org.apache.hop.core.lifecycle;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-
-/**
- * Created by mburgess on 10/12/15.
- */
-public class LifeEventInfoTest {
-
- LifeEventInfo info;
-
- @Before
- public void setUp() throws Exception {
- info = new LifeEventInfo();
- }
-
- @Test
- public void testSetHasHint() throws Exception {
- LifeEventInfo.Hint hint = LifeEventInfo.Hint.DISPLAY_BROWSER;
- assertFalse( info.hasHint( null ) );
- assertFalse( info.hasHint( hint ) );
- info.setHint( hint );
- assertTrue( info.hasHint( hint ) );
- assertFalse( info.hasHint( LifeEventInfo.Hint.DISPLAY_MSG_BOX ) );
- }
-
- @Test
- public void testGetSetMessage() throws Exception {
- assertNull( info.getMessage() );
- info.setMessage( "message" );
- assertEquals( "message", info.getMessage() );
- }
-
- @Test
- public void testGetState() throws Exception {
- assertNull( info.getState() );
- info.setState( LifeEventInfo.State.FAIL );
- assertEquals( LifeEventInfo.State.FAIL, info.getState() );
- }
-
- @Test
- public void testGetName() throws Exception {
- assertNull( info.getName() );
- info.setName( "name" );
- assertEquals( "name", info.getName() );
- }
-}
diff --git a/core/src/test/java/org/apache/hop/core/lifecycle/LifecycleExceptionTest.java b/core/src/test/java/org/apache/hop/core/lifecycle/LifecycleExceptionTest.java
deleted file mode 100644
index e51f893..0000000
--- a/core/src/test/java/org/apache/hop/core/lifecycle/LifecycleExceptionTest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*! ******************************************************************************
- *
- * Hop : The Hop Orchestration Platform
- *
- * Copyright (C) 2016 - 2017 by Hitachi Vantara : http://www.pentaho.com
- *
- *******************************************************************************
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************************/
-
-package org.apache.hop.core.lifecycle;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-
-/**
- * Created by mburgess on 10/12/15.
- */
-public class LifecycleExceptionTest {
-
- LifecycleException exception;
-
- @Before
- public void setUp() throws Exception {
- exception = new LifecycleException( true );
- }
-
- @Test
- public void testIsSevere() throws Exception {
- assertTrue( exception.isSevere() );
- }
-
- @Test
- public void testMessage() {
- exception = new LifecycleException( "message", false );
- assertEquals( "message", exception.getMessage() );
- }
-
- @Test
- public void testThrowableCtor() {
- Throwable t = mock( Throwable.class );
- exception = new LifecycleException( t, true );
- assertEquals( t, exception.getCause() );
- }
-
- @Test
- public void testThrowableMessageCtor() {
- Throwable t = mock( Throwable.class );
- exception = new LifecycleException( "message", t, true );
- assertEquals( t, exception.getCause() );
- assertEquals( "message", exception.getMessage() );
- assertTrue( exception.isSevere() );
- }
-}
diff --git a/engine/src/main/java/org/apache/hop/core/HopEnvironment.java b/engine/src/main/java/org/apache/hop/core/HopEnvironment.java
index 9a860f2..b7a8993 100644
--- a/engine/src/main/java/org/apache/hop/core/HopEnvironment.java
+++ b/engine/src/main/java/org/apache/hop/core/HopEnvironment.java
@@ -1,24 +1,19 @@
-/*! ******************************************************************************
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
- * Hop : The Hop Orchestration Platform
- *
- * Copyright (C) 2002-2018 by Hitachi Vantara : http://www.pentaho.com
- *
- *******************************************************************************
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
- ******************************************************************************/
+ */
package org.apache.hop.core;
@@ -35,7 +30,6 @@ import org.apache.hop.core.extension.ExtensionPointHandler;
import org.apache.hop.core.extension.HopExtensionPoint;
import org.apache.hop.core.logging.LogChannel;
import org.apache.hop.core.plugins.ActionPluginType;
-import org.apache.hop.core.plugins.HopLifecyclePluginType;
import org.apache.hop.core.plugins.HopServerPluginType;
import org.apache.hop.core.plugins.IPluginType;
import org.apache.hop.core.plugins.PartitionerPluginType;
@@ -85,7 +79,6 @@ public class HopEnvironment {
TransformPluginType.getInstance(),
PartitionerPluginType.getInstance(),
ActionPluginType.getInstance(),
- HopLifecyclePluginType.getInstance(),
HopServerPluginType.getInstance(),
CompressionPluginType.getInstance(),
AuthenticationProviderPluginType.getInstance(),
diff --git a/engine/src/main/java/org/apache/hop/core/annotations/HopLifecyclePlugin.java b/engine/src/main/java/org/apache/hop/core/annotations/HopLifecyclePlugin.java
deleted file mode 100644
index a4d7610..0000000
--- a/engine/src/main/java/org/apache/hop/core/annotations/HopLifecyclePlugin.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*! ******************************************************************************
- *
- * Hop : The Hop Orchestration Platform
- *
- * Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com
- *
- *******************************************************************************
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************************/
-
-package org.apache.hop.core.annotations;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Defines a Hop Lifecycle Plugin that will be invoked during Hop Environment initialization and shutdown.
- */
-@Documented
-@Retention( RetentionPolicy.RUNTIME )
-@Target( ElementType.TYPE )
-public @interface HopLifecyclePlugin {
-
- String id();
-
- String name() default "";
-
- /**
- * @return {@code true} if a separate class loader is needed every time this class is instantiated
- */
- boolean isSeparateClassLoaderNeeded() default false;
-
- String classLoaderGroup() default "";
-}
diff --git a/engine/src/main/java/org/apache/hop/core/annotations/LifecyclePlugin.java b/engine/src/main/java/org/apache/hop/core/annotations/LifecyclePlugin.java
deleted file mode 100644
index 36978cb..0000000
--- a/engine/src/main/java/org/apache/hop/core/annotations/LifecyclePlugin.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*! ******************************************************************************
- *
- * Hop : The Hop Orchestration Platform
- *
- * Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com
- *
- *******************************************************************************
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************************/
-
-package org.apache.hop.core.annotations;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Documented
-@Retention( RetentionPolicy.RUNTIME )
-@Target( ElementType.TYPE )
-public @interface LifecyclePlugin {
- String id();
-
- String name() default "";
-
- String classLoaderGroup() default "";
-}
diff --git a/engine/src/main/java/org/apache/hop/core/plugins/HopLifecyclePluginType.java b/engine/src/main/java/org/apache/hop/core/plugins/HopLifecyclePluginType.java
deleted file mode 100644
index 2c62c8e..0000000
--- a/engine/src/main/java/org/apache/hop/core/plugins/HopLifecyclePluginType.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*! ******************************************************************************
- *
- * Hop : The Hop Orchestration Platform
- *
- * Copyright (C) 2002-2018 by Hitachi Vantara : http://www.pentaho.com
- *
- *******************************************************************************
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************************/
-
-package org.apache.hop.core.plugins;
-
-import org.apache.hop.core.Const;
-import org.apache.hop.core.annotations.HopLifecyclePlugin;
-import org.apache.hop.core.lifecycle.IHopLifecycleListener;
-
-import java.util.Map;
-
-/**
- * Defines a Hop Environment lifecycle plugin type. These plugins are invoked at Hop Environment initialization
- * and shutdown.
- */
-@PluginMainClassType( IHopLifecycleListener.class )
-@PluginAnnotationType( HopLifecyclePlugin.class )
-public class HopLifecyclePluginType extends BasePluginType<HopLifecyclePlugin> implements IPluginType<HopLifecyclePlugin> {
-
- private static HopLifecyclePluginType pluginType;
-
- private HopLifecyclePluginType() {
- super( HopLifecyclePlugin.class, "HOP LIFECYCLE LISTENERS", "Hop Lifecycle Listener Plugin Type" );
- // We must call populate folders so PluginRegistry will look in the correct
- // locations for plugins (jars with annotations)
- populateFolders( null );
- }
-
- public static synchronized HopLifecyclePluginType getInstance() {
- if ( pluginType == null ) {
- pluginType = new HopLifecyclePluginType();
- }
- return pluginType;
- }
-
- @Override
- protected String getXmlPluginFile() {
- return Const.XML_FILE_HOP_LIFECYCLE_LISTENERS;
- }
-
- @Override
- protected String getMainTag() {
- return "listeners";
- }
-
- @Override
- protected String getSubTag() {
- return "listener";
- }
-
- @Override
- protected boolean isReturn() {
- return true;
- }
-
- @Override
- protected String extractID( HopLifecyclePlugin annotation ) {
- return annotation.id();
- }
-
- @Override
- protected String extractName( HopLifecyclePlugin annotation ) {
- return annotation.name();
- }
-
- @Override
- protected String extractDesc( HopLifecyclePlugin annotation ) {
- return "";
- }
-
- @Override
- protected String extractCategory( HopLifecyclePlugin annotation ) {
- // No images, not shown in UI
- return "";
- }
-
- @Override
- protected String extractImageFile( HopLifecyclePlugin annotation ) {
- // No images, not shown in UI
- return null;
- }
-
- @Override
- protected boolean extractSeparateClassLoader( HopLifecyclePlugin annotation ) {
- return annotation.isSeparateClassLoaderNeeded();
- }
-
- @Override
- protected String extractI18nPackageName( HopLifecyclePlugin annotation ) {
- // No UI, no i18n
- return null;
- }
-
- @Override
- protected void addExtraClasses( Map<Class<?>, String> classMap, Class<?> clazz, HopLifecyclePlugin annotation ) {
- classMap.put( HopLifecyclePlugin.class, clazz.getName() );
- }
-
- @Override
- protected String extractDocumentationUrl( HopLifecyclePlugin annotation ) {
- return null;
- }
-
- @Override
- protected String extractCasesUrl( HopLifecyclePlugin annotation ) {
- return null;
- }
-
- @Override
- protected String extractForumUrl( HopLifecyclePlugin annotation ) {
- return null;
- }
-
- @Override
- protected String extractSuggestion( HopLifecyclePlugin annotation ) {
- return null;
- }
-
- @Override
- protected String extractClassLoaderGroup( HopLifecyclePlugin annotation ) {
- return annotation.classLoaderGroup();
- }
-}
diff --git a/plugins/transforms/metainject/src/main/java/org/apache/hop/pipeline/transforms/metainject/OpenMappingExtension.java b/plugins/transforms/metainject/src/main/java/org/apache/hop/pipeline/transforms/metainject/OpenMappingExtension.java
deleted file mode 100644
index fa87914..0000000
--- a/plugins/transforms/metainject/src/main/java/org/apache/hop/pipeline/transforms/metainject/OpenMappingExtension.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*! ******************************************************************************
- *
- * Hop : The Hop Orchestration Platform
- *
- * Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com
- * http://www.project-hop.org
- *
- *******************************************************************************
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************************/
-
-package org.apache.hop.pipeline.transforms.metainject;
-
-
-import org.apache.hop.core.exception.HopException;
-import org.apache.hop.core.extension.ExtensionPoint;
-import org.apache.hop.core.extension.IExtensionPoint;
-import org.apache.hop.core.lifecycle.ILifecycleListener;
-import org.apache.hop.core.logging.ILogChannel;
-import org.apache.hop.i18n.BaseMessages;
-import org.apache.hop.pipeline.PipelineMeta;
-import org.apache.hop.pipeline.transform.TransformMeta;
-
-/**
- * Created by bmorrise on 7/26/16.
- */
-@ExtensionPoint(
- id = "OpenMapping",
- description = "Update Trans Meta based on MetaInjectMeta being the transform type",
- extensionPointId = "OpenMapping" )
-public class OpenMappingExtension implements IExtensionPoint {
-
- //spoon class without import of swt libraries, big-data pmr run doesn't have ui library and shouldn't
- private static final Class<?> PKG = ILifecycleListener.class;
-
- @Override public void callExtensionPoint(ILogChannel log, Object object ) throws HopException {
- TransformMeta transformMeta = (TransformMeta) ( (Object[]) object )[ 0 ];
- PipelineMeta piprlineMeta = (PipelineMeta) ( (Object[]) object )[ 1 ];
-
- if ( transformMeta.getTransform() instanceof MetaInjectMeta ) {
- // Make sure we don't accidently overwrite this transformation so we'll remove the filename and objectId
- // Modify the name so the users sees it's a result
- piprlineMeta.setFilename( null );
-// piprlineMeta.setObjectId( null );
- String appendName = " (" + BaseMessages.getString( PKG, "TransGraph.AfterInjection" ) + ")";
- if ( !piprlineMeta.getName().endsWith( appendName ) ) {
- piprlineMeta.setName( piprlineMeta.getName() + appendName );
- }
- }
- }
-}
diff --git a/plugins/transforms/metainject/src/test/java/org/apache/hop/pipeline/transforms/metainject/OpenMappingExtensionTest.java b/plugins/transforms/metainject/src/test/java/org/apache/hop/pipeline/transforms/metainject/OpenMappingExtensionTest.java
deleted file mode 100644
index f697819..0000000
--- a/plugins/transforms/metainject/src/test/java/org/apache/hop/pipeline/transforms/metainject/OpenMappingExtensionTest.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*!
- * Copyright 2010 - 2018 Hitachi Vantara. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.hop.pipeline.transforms.metainject;
-
-import org.apache.hop.core.HopEnvironment;
-import org.apache.hop.core.exception.HopException;
-import org.apache.hop.core.lifecycle.IHopLifecycleListener;
-import org.apache.hop.core.logging.HopLogStore;
-import org.apache.hop.core.logging.ILogChannel;
-import org.apache.hop.core.logging.ILogChannelFactory;
-import org.apache.hop.i18n.BaseMessages;
-import org.apache.hop.junit.rules.RestoreHopEngineEnvironment;
-import org.apache.hop.pipeline.PipelineMeta;
-import org.apache.hop.pipeline.transform.TransformMeta;
-import org.junit.*;
-
-
-import static org.mockito.Mockito.*;
-
-/**
- * Created by Vasilina_Terehova on 3/31/2017.
- */
-public class OpenMappingExtensionTest{
-
- public static final String PIPELINE_META_NAME = "Test name";
- private static ILogChannel logChannelInterface;
- private PipelineMeta pipelineMeta;
- private TransformMeta transformMeta;
- private Object[] metaData;
-
- @ClassRule public static RestoreHopEngineEnvironment env = new RestoreHopEngineEnvironment();
-
- @BeforeClass
- public static void setupClass() throws HopException{
- HopEnvironment.init();
- }
-
- @Before
- public void setup() {
-// setup();
- PipelineMeta pipelineMeta = spy( new PipelineMeta() );
- transformMeta = mock( TransformMeta.class );
- metaData = new Object[] { transformMeta, pipelineMeta };
- setKettleLogFactoryWithMock();
- }
-
- @Test
- @Ignore
- public void testLocalizedMessage() throws HopException {
- OpenMappingExtension openMappingExtension = new OpenMappingExtension();
- Class PKG = IHopLifecycleListener.class;
- String afterInjectionMessageAdded = BaseMessages.getString( PKG, "PipelineGraph.AfterInjection" );
- PipelineMeta pipelineMeta = spy( new PipelineMeta() );
- pipelineMeta.setName(PIPELINE_META_NAME);
- doReturn( mock( MetaInjectMeta.class ) ).when(transformMeta).getTransform();
- openMappingExtension.callExtensionPoint( logChannelInterface, metaData );
- assert ( pipelineMeta.getName().contains( afterInjectionMessageAdded ) );
- }
-
- private void setKettleLogFactoryWithMock() {
- ILogChannelFactory logChannelInterfaceFactory = mock( ILogChannelFactory.class );
- logChannelInterface = mock( ILogChannel.class );
- when( logChannelInterfaceFactory.create( any() ) ).thenReturn( logChannelInterface );
- HopLogStore.setLogChannelFactory( logChannelInterfaceFactory );
- }
-}