Skip to content

Instantly share code, notes, and snippets.

View tristantarrant's full-sized avatar
🏠
Working from home

Tristan Tarrant tristantarrant

🏠
Working from home
  • Red Hat
  • Italy
View GitHub Profile
package net.dataforte.classretentionuser;
import net.dataforte.classretention.SimpleAnnotation;
import net.dataforte.classretention.SimpleEnum;
public class SimpleClass {
@SimpleAnnotation(aSimpleEnum=SimpleEnum.ONE, anInt=1, aString="s")
void aMethod() {
System.out.println("ok");
package net.dataforte.classretention;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
public @interface SimpleAnnotation {
@tristantarrant
tristantarrant / gist:1400548
Created November 28, 2011 14:14
JDBC Store for AS7.1
<jdbc-store datasource="java:jboss/jdbc/store" fetch-state="false" passivation="false" preload="true" purge="false" shared="true" singleton="true">
<bucket-table prefix="ispn_bucket" batch-size="100" fetch-size="100">
<id-column name="id" type="VARCHAR"/>
<data-column name="datum" type="BINARY"/>
<timestamp-column name="version" type="BIGINT"/>
</bucket-table>
<entry-table prefix="ispn_entry" batch-size="100" fetch-size="100">
<id-column name="id" type="VARCHAR"/>
<data-column name="datum" type="BINARY"/>
<timestamp-column name="version" type="BIGINT"/>
@tristantarrant
tristantarrant / gist:1400551
Created November 28, 2011 14:15
Remote Store for AS7.1
<remote-store cache="default" socket-timeout="60000" tcp-no-delay="true" fetch-state="false" passivation="false" preload="true" purge="false" shared="true" singleton="true">
<remote-server outbound-socket-binding="hotrod-server-1" />
<remote-server outbound-socket-binding="hotrod-server-2" />
<property name="hotrod.property">value</property>
</remote-store>
<distributed-cache name="default" start="EAGER"
mode="SYNC" virtual-nodes="1" owners="2" batching="false"
indexing="NONE" l1-lifespan="0" remote-timeout="30000">
<locking isolation="READ_COMMITTED"
acquire-timeout="30000" concurrency-level="1000"
striping="false" />
<transaction eager-locking="ALL" mode="FULL_XA" stop-timeout="60000"/>
<rehashing enabled="true" timeout="600000" />
<jdbc-store datasource="java:jboss/datasources/ExampleDS" fetch-state="false" passivation="false" preload="true" purge="false" shared="true">
<bucket-table prefix="ispn_bucket" batch-size="100" fetch-size="100">
if (cache.hasDefined(ModelKeys.BATCHING)) {
InvocationBatchingConfigurationBuilder batchingBuilder = builder.transaction().transactionMode(org.infinispan.transaction.TransactionMode.TRANSACTIONAL).invocationBatching();
if (cache.get(ModelKeys.BATCHING).asBoolean()) {
batchingBuilder.enable();
} else {
batchingBuilder.disable();
}
}
@tristantarrant
tristantarrant / module.xml
Created February 10, 2012 16:05
Transformed module.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2010, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
@tristantarrant
tristantarrant / gist:2224567
Created March 28, 2012 07:52
Duplicated JARs in Infinispan distribution
2 aopalliance-1.0.jar
2 avalon-framework-4.1.3.jar
2 guava-r08.jar
2 jackson-core-asl-1.9.2.jar
2 jackson-mapper-asl-1.9.2.jar
2 javax.inject-1.jar
2 jboss-logging-3.1.0.GA.jar
2 jboss-marshalling-1.3.6.GA.jar
2 jboss-marshalling-river-1.3.6.GA.jar
2 jgroups-3.0.8.Final.jar
@tristantarrant
tristantarrant / gist:2299604
Created April 4, 2012 08:01
AS7 JDBC Statement caching
<statement>
<track-statements>true</track-statements>
<prepared-statement-cache-size>15</prepared-statement-cache-size>
<share-prepared-statements/>
</statement>
@tristantarrant
tristantarrant / datagrid.xml
Created April 12, 2012 15:18
datagrid config assembly
<?xml version='1.0' encoding='UTF-8'?>
<!-- See src/resources/configuration/ReadMe.txt for how the configuration assembly works -->
<config default-supplement="default">
<extension-module>com.jboss.datagrid</extension-module>
<subsystem xmlns="urn:jboss:domain:datagrid:1.0">
<hotrod-connector socket-binding="hotrod" cache-container="@@default-cache-container@@">
<topology-state-transfer lazy-retrieval="false" lock-timeout="1000" replication-timeout="5000" />
</hotrod-connector>
<memcached-connector socket-binding="memcached" cache-container="@@default-cache-container@@" />
<rest-connector virtual-server="default-host" cache-container="@@default-cache-container@@" />