Skip to content

Instantly share code, notes, and snippets.

View milenkovicm's full-sized avatar
🤿

Marko Milenković milenkovicm

🤿
View GitHub Profile
package com.e.test.service.first.controller;
import javax.ejb.MessageDriven;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;
import javax.ejb.ActivationConfigProperty;
@MessageDriven(name = "MDBService", activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@milenkovicm
milenkovicm / SendMessageService.java
Created February 5, 2012 00:25
send message using SLSB
package com.e.test.service.first.controller;
import javax.annotation.Resource;
import javax.ejb.Stateless;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.Session;
@milenkovicm
milenkovicm / SendMessageService.java
Created February 5, 2012 00:28
send message using singlton
package com.e.test.service.first.controller;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import javax.ejb.Lock;
import javax.ejb.LockType;
import javax.ejb.Singleton;
import javax.ejb.Startup;
import javax.jms.Connection;
@milenkovicm
milenkovicm / pom.xml
Created February 20, 2012 13:22
separation of functional and integration tests
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>remote</artifactId>
<groupId>com.example</groupId>
<version>1.0-SNAPSHOT</version>
@milenkovicm
milenkovicm / log4j.properties
Created February 23, 2012 20:43
log4j properties
log4j.rootLogger=DEBUG, STDOUT
log4j.logger.org.jboss=INFO
log4j.logger.org.hibernate=INFO
log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
log4j.appender.STDOUT.Threshold=DEBUG
log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
log4j.appender.STDOUT.layout.ConversionPattern= %-5p | %-30.30c{1}%x | %m%n
@milenkovicm
milenkovicm / arquillian.xml
Created February 24, 2012 22:44
[Junit] Arquillian - arquillian.xml with multiple AS containers
<?xml version="1.0" encoding="UTF-8"?>
<arquillian
xmlns="http://jboss.org/schema/arquillian"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<container qualifier="weld" default="true">
<configuration>
<property name="enableConversationScope">true</property>
</configuration>
@milenkovicm
milenkovicm / pom.xml
Created February 24, 2012 22:46
[mvn ] pom - pom.xml with multiple arquillian profiles
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>weld-core-parent</artifactId>
<groupId>org.jboss.weld</groupId>
<version>1.1.6-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core-test-arquillian</artifactId>
@milenkovicm
milenkovicm / pom.xml
Created March 5, 2012 15:03
[mvn] pom - my multiple test profiles
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>integration</artifactId>
<groupId>xxxx</groupId>
<version>1.0.2-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>jee</artifactId>
@milenkovicm
milenkovicm / LoggerProducer.java
Created March 6, 2012 14:18
[Java] CDI - Slf4j Logger Producer
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.InjectionPoint;
import javax.inject.Singleton;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Singleton
public class LoggerProducer {
@milenkovicm
milenkovicm / eclipse_cleanup.xml
Created March 10, 2012 16:53
[eclipse] settings - java code cleanup
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="2">
<profile kind="CleanUpProfile" name="MM_eclipse" version="2">
<setting id="cleanup.remove_unused_private_fields" value="true"/>
<setting id="cleanup.always_use_parentheses_in_expressions" value="false"/>
<setting id="cleanup.never_use_blocks" value="false"/>
<setting id="cleanup.remove_unused_private_methods" value="true"/>
<setting id="cleanup.add_missing_deprecated_annotations" value="true"/>
<setting id="cleanup.convert_to_enhanced_for_loop" value="false"/>
<setting id="cleanup.remove_unnecessary_nls_tags" value="true"/>