Skip to content

Instantly share code, notes, and snippets.

@atishn
atishn / Tetsing
Created August 1, 2014 15:15
Testing first Gist
<test>
<start>
Testing
</start>
</test>
@atishn
atishn / Maven
Created August 1, 2014 19:17
Java Melody Maven Configuration
<dependency>
<groupId>net.bull.javamelody</groupId>
<artifactId>javamelody-core</artifactId>
<version>1.47.0</version>
</dependency>
<!-- itext, option to add PDF export -->
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
<version>2.1.7</version>
@atishn
atishn / WebApplication Config
Created August 1, 2014 19:18
Java Melody Web Configuration
<!-- Custom CSS -->
   <filter>
       <filter-name>customResourceFilter</filter-name>
      <filter-class>net.bull.javamelody.CustomResourceFilter</filter-class>
       <init-param>
           <param-name>monitoring.css</param-name>
           <param-value>/styles/monitoring.css</param-value>
       </init-param>
   </filter>
   <filter-mapping>
@atishn
atishn / Spring security
Created August 1, 2014 19:19
Java Melody Spring Configuration
<http auto-config="true" use-expressions="true">
<intercept-url pattern="/monitoring/**" access="hasRole('ROLE_ADMIN')" />
<intercept-url pattern="/**" access="hasAnyRole('ROLE_ADMIN, 'ROLE_USER'')" />
</http>
@atishn
atishn / EhCache
Created August 1, 2014 19:20
Java Melody Configuration
<defaultCache maxElementsInMemory="10000"
eternal="false"
    overflowToDisk="false"
    timeToIdleSeconds="1800"
    timeToLiveSeconds="1800"
    diskPersistent="false"
    diskExpiryThreadIntervalSeconds="120"
    statistics="true"
    memoryStoreEvictionPolicy="LRU"/>
@atishn
atishn / SqlData Config
Created August 1, 2014 19:20
Java Melody Configuration
<jee:jndi-lookup id="dataSource" jndi-name="jdbc/myAppDS"/>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource" />
@atishn
atishn / Spring Config
Created August 1, 2014 19:21
Java Melody Configuration
<bean id="facadeMonitoringAdvisor">
<property name="pointcut">
<bean>
<property name="pattern" value=".*Service.*" />
</bean>
</property>
</bean>
@atishn
atishn / Spring Config
Created August 1, 2014 19:21
Java Melody Configuration
Case1
@net.bull.javamelody.MonitoredWithSpring
public interface Test {
void myMethod();
}
or
Case2
public interface Test {
     @net.bull.javamelody.MonitoredWithSpring
        void myMethod();
@atishn
atishn / Spring Config
Created August 1, 2014 19:22
Java Melody Configuration
<bean id="facadeMonitoringAdvisor">
<property name="pointcut">
<bean>
<property name="interfaceName" value="com.xyz.Facade" />
</bean>
</property>
</bean>
@atishn
atishn / Maven Config
Created August 1, 2014 19:23
Jacoco Configuration
<?xml version="1.0" encoding="UTF-8"?>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.6.4.201312101107</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>