GZIPInInterceptor,
simple as creating instance and adding as in-Interceptor to service endpoint
GZIPOutInterceptor,
simple as creating instance and adding as out-Interceptor to service endpoint, make sure to define threshold value when creating insance
GZIPInInterceptor gzipInInterceptor = new GZIPInInterceptor();
GZIPOutInterceptor gzipOutInterceptor = new GZIPOutInterceptor(0);
server.getEndpoint().getInInterceptors().add(gzipInInterceptor);
server.getEndpoint().getOutInterceptors().add(gzipOutInterceptor);
Wednesday, November 5, 2014
Monday, November 3, 2014
How to configure custom check style plugin
Mainly there are 3 files to configure
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<version>2.10</version>
<dependencies>
<dependency>
<groupId>com.intel.ase.osg</groupId>
<artifactId>com.intel.ase.osg.governance</artifactId>
<version>${ase.osg.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<configLocation>../com.intel.ase.osg.governance/src/main/resources/governance/osg_checks.xml</configLocation>
<suppressionsLocation>../com.intel.ase.osg.governance/src/main/resources/governance/checkstyle-suppressions.xml</suppressionsLocation>
<!--<headerLocation>governance/header.txt</headerLocation>-->
<propertyExpansion>config_loc=../com.intel.ase.osg.governance/src/main/resources/governance</propertyExpansion>
<consoleOutput>true</consoleOutput>
<failOnViolation>true</failOnViolation>
<includeTestSourceDirectory>false</includeTestSourceDirectory>
</configuration>
</execution>
</executions>
</plugin>
Sample java code usage after configuration,
public class IdentityServiceException extends Exception {
// CHECKSTYLE:OFF
private IdentityError error;
// CHECKSTYLE:ON
..................................
2. Using suppress expression
include below line to checkstyle-suppressions.xml
- checks.xml
- checkstyle-suppressions
- pom.xml
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<version>2.10</version>
<dependencies>
<dependency>
<groupId>com.intel.ase.osg</groupId>
<artifactId>com.intel.ase.osg.governance</artifactId>
<version>${ase.osg.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<configLocation>../com.intel.ase.osg.governance/src/main/resources/governance/osg_checks.xml</configLocation>
<suppressionsLocation>../com.intel.ase.osg.governance/src/main/resources/governance/checkstyle-suppressions.xml</suppressionsLocation>
<!--<headerLocation>governance/header.txt</headerLocation>-->
<propertyExpansion>config_loc=../com.intel.ase.osg.governance/src/main/resources/governance</propertyExpansion>
<consoleOutput>true</consoleOutput>
<failOnViolation>true</failOnViolation>
<includeTestSourceDirectory>false</includeTestSourceDirectory>
</configuration>
</execution>
</executions>
</plugin>
- How to suppress check-style validation for particular class
- Using SuppressionCommentFilter
Sample java code usage after configuration,
public class IdentityServiceException extends Exception {
// CHECKSTYLE:OFF
private IdentityError error;
// CHECKSTYLE:ON
..................................
2. Using suppress expression
include below line to checkstyle-suppressions.xml
<suppress files="TheClassToIgnore\.java" checks="[a-zA-Z0-9]*"/>
Subscribe to:
Posts (Atom)