Skip to content

Commit

Permalink
Merge pull request #13 from asha15/scr
Browse files Browse the repository at this point in the history
Change the scr doc comment to component annotation
  • Loading branch information
senthalan authored Jan 10, 2023
2 parents 14eb685 + 3a1cc88 commit 7360d7e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 56 deletions.
42 changes: 5 additions & 37 deletions component/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,7 @@
<name>WSO2 Carbon - Authenticator Library For pinterest</name>
<url>http://wso2.org</url>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.5</version>
<extensions>true</extensions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
Expand Down Expand Up @@ -80,19 +61,6 @@
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<version>1.7.2</version>
<executions>
<execution>
<id>generate-scr-scrdescriptor</id>
<goals>
<goal>scr</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down Expand Up @@ -156,6 +124,11 @@
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.ds-annotations</artifactId>
<version>${apache.felix.scr.ds.annotations.version}</version>
</dependency>
<!--Test Dependencies-->
<dependency>
<groupId>org.testng</groupId>
Expand All @@ -182,11 +155,6 @@
<artifactId>powermock-api-mockito</artifactId>
<version>${powermock.version}</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
<version>${felix.scr.version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,17 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.osgi.service.component.ComponentContext;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Deactivate;
import org.wso2.carbon.identity.application.authentication.framework.ApplicationAuthenticator;
import org.wso2.carbon.identity.authenticator.pinterest.PinterestAuthenticator;

import java.util.Hashtable;

/**
* @scr.component name="identity.application.authenticator.pinterest.component" immediate="true"
*/
@Component(
name="identity.application.authenticator.pinterest.component",
immediate= true)
public class PinterestAuthenticatorServiceComponent {

private static final Log log = LogFactory.getLog(PinterestAuthenticatorServiceComponent.class);
Expand All @@ -39,6 +42,7 @@ public class PinterestAuthenticatorServiceComponent {
*
* @param componentContext the Component Context
*/
@Activate
protected void activate(ComponentContext componentContext) {
PinterestAuthenticator authenticator = new PinterestAuthenticator();
Hashtable<String, String> props = new Hashtable<>();
Expand All @@ -54,6 +58,7 @@ protected void activate(ComponentContext componentContext) {
*
* @param componentContext the Component Context
*/
@Deactivate
protected void deactivate(ComponentContext componentContext) {
if (log.isDebugEnabled()) {
log.debug("Pinterest authenticator is deactivated");
Expand Down
35 changes: 19 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,17 @@
<classifier>runtime</classifier>
<version>${jacoco.version}</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.ds-annotations</artifactId>
<version>${apache.felix.scr.ds.annotations.version}</version>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<scope>test</scope>
<version>${powermock.version}</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
<version>${felix.scr.version}</version>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
Expand Down Expand Up @@ -253,10 +253,22 @@
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.2.0</version>
<extensions>true</extensions>
<configuration>
<obrRepository>NONE</obrRepository>
<instructions>
<SCM-Revision>${buildNumber}</SCM-Revision>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<version>1.7.2</version>
<version>1.26.0</version>
<executions>
<execution>
<id>generate-scr-scrdescriptor</id>
Expand All @@ -266,15 +278,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.5</version>
<extensions>true</extensions>
<configuration>
<obrRepository>NONE</obrRepository>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand Down Expand Up @@ -317,7 +320,6 @@
<carbon.identity.version>5.0.7</carbon.identity.version>
<commons-logging.version>4.4.3</commons-logging.version>
<carbon.kernel.version>4.4.3</carbon.kernel.version>
<felix.scr.version>1.12.0</felix.scr.version>
<oltu.version>1.0.0.wso2v2</oltu.version>
<org.apache.oltu.oauth2.client.version>1.0.0</org.apache.oltu.oauth2.client.version>
<oltu.package.import.version.range>[1.0.0, 2.0.0)</oltu.package.import.version.range>
Expand All @@ -326,6 +328,7 @@
<javax.servelet.jstl.version>1.2</javax.servelet.jstl.version>
<commons-codec.version>1.4.0.wso2v1</commons-codec.version>
<axiom.version>1.2.11-wso2v6</axiom.version>
<apache.felix.scr.ds.annotations.version>1.2.4</apache.felix.scr.ds.annotations.version>
<org.json>[3.0,4)</org.json>
<org.wso2.securevault.version>1.0.0-wso2v2</org.wso2.securevault.version>
<commons-lang.wso2.version>2.6.0.wso2v1</commons-lang.wso2.version>
Expand Down

0 comments on commit 7360d7e

Please sign in to comment.