Skip to content

Instantly share code, notes, and snippets.

View splatch's full-sized avatar

Łukasz Dywicki splatch

View GitHub Profile
@splatch
splatch / Splitter.java
Created November 27, 2012 12:27
Simple java class which reads assembly component and split it into smaller parts.
import java.io.FileReader;
import java.util.HashMap;
import java.util.Map;
import org.apache.maven.plugin.assembly.model.Component;
import org.apache.maven.plugin.assembly.model.DependencySet;
import org.apache.maven.plugin.assembly.model.FileItem;
import org.apache.maven.plugin.assembly.model.FileSet;
import org.apache.maven.plugin.assembly.model.io.xpp3.ComponentXpp3Reader;
import org.apache.maven.plugin.assembly.model.io.xpp3.ComponentXpp3Writer;
<?xml version="1.0" encoding="UTF-8"?>
<!--
JBoss, Home of Professional Open Source
Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
as indicated by the @authors tag. All rights reserved.
See the copyright.txt in the distribution for a
full listing of individual contributors.
This copyrighted material is made available to anyone wishing to use,
modify, copy, or redistribute it subject to the terms and conditions
18:26:42,084 INFO [SwitchYardCamelContext] Route: direct:inOut started and consuming from: Endpoint[direct://inOut]
org.switchyard.HandlerException: java.lang.RuntimeException: Runtime error
18:26:42,148 INFO [SwitchYardCamelContext] Apache Camel 2.10.0 (CamelContext: camel-1) is shutting down
at org.switchyard.bus.camel.audit.FaultProcessor.detectHandlerException(FaultProcessor.java:82)
at org.switchyard.bus.camel.audit.FaultProcessor.handle(FaultProcessor.java:73)
at org.switchyard.bus.camel.audit.FaultProcessor$1.done(FaultProcessor.java:57)
at org.apache.camel.management.InstrumentationProcessor$1.done(InstrumentationProcessor.java:82)
at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:67)
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
@ApplicationScoped
public class JmsFactory {
@Produces @Named("jms")
public JmsComponent first() { return new JmsComponent(); }
@Produces @Named("jmsx")
public JmsComponent second() { return new JmsComponent(); }
}
@splatch
splatch / access.xml
Created February 17, 2013 13:06
Advanced configuration of security with OSGi Conditional Permission Admin.
<?xml version="1.0" encoding="utf-8" ?>
<policies xmlns="http://code-house.org/cpm/admin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://code-house.org/cpm/admin policies.xsd">
<policy>
<allow>
<condition class="org.osgi.service.condpermadmin.BundleLocationCondition">
<argument>mvn:org.code-house.cpm/org.code-house.cpm.test/*</argument>
</condition>
<condition class="org.code_house.cpm.condition.PrincipalCondition">
@splatch
splatch / UnwrapUtility.java
Created March 19, 2013 19:22
Small utility class which gets rid of "necessary" processors from stack frame.
package experiments;
import java.lang.reflect.Field;
import org.apache.camel.AsyncProcessor;
import org.apache.camel.Processor;
import org.apache.camel.management.InstrumentationProcessor;
import org.apache.camel.processor.DelegateAsyncProcessor;
import org.apache.camel.processor.InterceptorToAsyncProcessorBridge;
import org.apache.camel.processor.SendProcessor;
<subsystem xmlns="urn:jboss:domain:switchyard:1.0">
<modules>
<module identifier="org.switchyard.component.bean" implClass="org.switchyard.component.bean.deploy.BeanComponent" />
<module identifier="org.switchyard.component.soap" implClass="org.switchyard.component.soap.deploy.SOAPComponent">
<properties>
<socketAddr>:18001</socketAddr>
</properties>
</module>
<module identifier="org.switchyard.component.camel" implClass="org.switchyard.component.camel.deploy.CamelComponent">
<properties>
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project maven-assembly-plugin: Compilation failure: Compilation failure:
[ERROR] /Users/lukasz/projects/maven-plugins/src/main/java/org/apache/maven/plugin/assembly/archive/phase/wrappers/RepoInfoWrapper.java:[90,19] cannot find symbol
[ERROR] symbol : method isIncludePoms()
[ERROR] location: class org.apache.maven.plugin.assembly.model.Repository
[ERROR] /Users/lukasz/projects/maven-plugins/target/generated-sources/modello/org/apache/maven/plugin/assembly/model/io/xpp3/AssemblyXpp3Reader.java:[1768,26] cannot find symbol
[ERROR] symbol : method setIncludePoms(boolean)
[ERROR] location: class org.apache.maven.plugin.assembly.model.Repository
[ERROR] /Users/lukasz/projects/maven-plugins/target/generated-sources/modello/org/apache/maven/plugin/assembly/model/io/xpp3/AssemblyXpp3Writer.java:[699,23] cannot find symbol
[ERROR] symbol : method isIncludePoms()
[ERROR] location: class org.apache.maven.
org.osgi.service.blueprint.container.ComponentDefinitionException: Error when instantiating bean cxf of class class org.apache.cxf.bus.blueprint.BlueprintBus
at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:333)[7:org.apache.aries.blueprint.core:1.1.0]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:806)[7:org.apache.aries.blueprint.core:1.1.0]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)[7:org.apache.aries.blueprint.core:1.1.0]
at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[7:org.apache.aries.blueprint.core:1.1.0]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_13]
at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_13]
at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[7:org.apache.aries.blueprint.core:1.1.0]
at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(Bluepri
{ // "Envelope type"
"type": "Person", // contents hint
"content": [ // here we expect only Person content
{ // Person()
"id": "00-00",
"name": "Mr Bean"
},
{ // Person()
"id": "00-01",