Skip to content

Instantly share code, notes, and snippets.

@rahulsh1
rahulsh1 / BundleCacheHook.java
Created August 10, 2018 08:00
OSGI BundleHook Implementation
package my.hooks;
import org.eclipse.osgi.internal.hookregistry.ClassLoaderHook;
import org.eclipse.osgi.internal.loader.ModuleClassLoader;
import org.eclipse.osgi.internal.loader.classpath.ClasspathEntry;
import org.eclipse.osgi.internal.loader.classpath.ClasspathManager;
import org.eclipse.osgi.internal.loader.classpath.FragmentClasspath;
import org.eclipse.osgi.storage.bundlefile.BundleFile;
import java.util.Enumeration;
package my.netty.http.upload;
import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.handler.codec.http.HttpRequestDecoder;
@rahulsh1
rahulsh1 / TreePrinter.java
Created April 9, 2017 17:51
Prints a nicely formatted binary tree
package foo;
import java.util.ArrayList;
import java.util.List;
/**
* Binary tree printer
* Taken from http://stackoverflow.com/questions/4965335/how-to-print-binary-tree-diagram - @author MightyPork
*
*/