Skip to content

Instantly share code, notes, and snippets.

@rahulsh1
rahulsh1 / BundleCacheHook.java
Created Aug 10, 2018
OSGI BundleHook Implementation
View BundleCacheHook.java
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;
View HttpUploadServerInitializer.java
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 Apr 9, 2017
Prints a nicely formatted binary tree
View TreePrinter.java
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
*
*/