Monday, July 20, 2015

How to install Java 8 & 7 on Ubuntu using Docker


There is no any official java docker images available for oracle java versions. If you need oracle java for your docker images, either you need to use unofficial docker which has java installed for you(there are plenty) or you can do it for your self, means you can install java on your own docker image which use any ubuntu based image as based image. Here I am explaining how you can install java 8 and java 7 on an ubuntu image.

Here is the docker file content which install oracle java 8(JDK1.8)on ubuntu trusty image.
# Pull base image. if you use "latest" instead of "trusty",
# you will use latest ubuntu images as base image
FROM ubuntu:trusty

# Set maintainer details
MAINTAINER SHAMEERA

# Install prerequisites
RUN apt-get update
RUN apt-get install -y software-properties-common

# Install java8
RUN add-apt-repository -y ppa:webupd8team/java
RUN apt-get update
RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
RUN apt-get install -y oracle-java8-installer
After you build and run this docker images. you can see the java version by using "java -version" command. It will output following.
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

You can use this docker image as your docker image's based image by using
FROM shameera/java8_trusty:latest
here is the docker hub link

Here is the docker file content which install oracle java 7(JDK1.7) on ubuntu trusty image.
# Pull base image. if you use "latest" instead of "trusty",
# you will use latest ubuntu images as base image
FROM ubuntu:trusty

# Set maintainer details
MAINTAINER SHAMEERA

# Install prerequisites
RUN apt-get update
RUN apt-get install -y software-properties-common

# Install java7
RUN add-apt-repository -y ppa:webupd8team/java
RUN apt-get update
RUN echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
RUN apt-get install -y oracle-java7-installer

"java -version" on this image outputs following.
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)


You can use this docker image as your docker image's based image by using
FROM shameera/java7_trusty:latest
Here is the docker hub link

Monday, March 3, 2014

Auto mount a partition at Startup - Linux

First we need find out UUID of the device, use ls -l /dev/disk/by-uuid to list the uuid of disks, Then you will output like below

lrwxrwxrwx 1 root root 10 Mar  3 21:04 4b2bce51-abde-4cc8-97dc-b72806ecbebb -> ../../sda1
lrwxrwxrwx 1 root root 10 Mar  3 21:04 662d99dc-b400-44ce-b227-e40fd8dfcab3 -> ../../sda6
lrwxrwxrwx 1 root root 10 Mar  3 21:04 a636c116-6716-4781-bbd9-10932226d1a9 -> ../../sda5
lrwxrwxrwx 1 root root 10 Mar  3 21:04 b0f84ace-f2c0-4e99-9df7-a6a0fb3b87b4 -> ../../sda7

Now you need  to add following entry to sudo /etc/fstab file , here you need to open this with sudo command to edit. And then add following line as last line of fstab file,

[Note: keep space between each entry ]
UUID=b0f84ace-f2c0-4e99-9df7-a6a0fb3b87b4 /media/shameera/Entertainment ext4 defaults 0 2

 Here my external device is sda7 so i have used UUID of that and i have use mount point as /media/shameera/Entertainment location, it's file format type is ext4. Change these values according to your device parameters, I have set mount option to defaults, dump and pass values are set to 0 and 2 respectively. Are you interesting in what are these defaults , dump and pass values are? then read this.

I tested this on Linux mint 15.


Sunday, February 9, 2014

Equinox 3.9.1 OSGi commands page .....

r - refresh the packages of the specified bundles; if -all option is specified refresh packages of all installed bundles
   scope: equinox
   flags:
      -all   specify to refresh the packages of all installed bundles
   parameters:
      Bundle[]   list of bundles whose packages to be refreshed; if not present refreshes all bundles

log - display all matching log entries
   scope: felix
   parameters:
      String   minimum log level [ debug | info | warn | error ]

log - display some matching log entries
   scope: felix
   parameters:
      int   maximum number of entries
      String   minimum log level [ debug | info | warn | error ]

p - display imported/exported package details
   scope: equinox
   parameters:
      Bundle[]   Bundle whose packages to display. If not present displays all exported packages

p - display imported/exported package details
   scope: equinox
   parameters:
      String   Package name of the package to display

install - install bundle using URLs
   scope: felix
   parameters:
      String[]   target URLs

props - Display system properties
   scope: equinox

i - install and optionally start bundle from the given URL
   scope: equinox
   flags:
      -start   spedify if the bundle should be started after installation
   parameters:
      String   Location of bundle to install

h - print bundle headers
   scope: equinox
   parameters:
      Bundle[]   bundles to print headers for

getopt
   scope: gogo
   parameters:
      List  
      Object[]  

fork - execute a command in a separate process
   scope: equinox
   parameters:
      String   command to be executed

disableBundle - Disable the specified bundle(s)
   scope: equinox
   parameters:
      long[]   IDs of bundle(s) to disable

sto - stop the specified bundle(s)
   scope: equinox
   parameters:
      Bundle[]   bundle(s) to stop

enableBundle - Enable the specified bundle(s)
   scope: equinox
   parameters:
      long[]   IDs of bundle(s) to enable

start - start bundles
   scope: felix
   flags:
      -p, --policy   use declared activation policy
      -t, --transient   start bundle transiently
   parameters:
      String[]   target bundle identifiers or URLs

s - display installed bundles and registered services
   scope: equinox
   parameters:
      String[]   [-s <comma separated list of bundle states>] [segment of bsn]

t - display threads and thread groups
   scope: equinox

t - stop the named thread with an IllegalStateException
   scope: equinox
   parameters:
      String   stop
      String   the thread on which to perform the action

t - stop the named thread with the provided throwable
   scope: equinox
   parameters:
      String   stop
      String   the thread on which to perform the action
      Class   the class of the throwable to throw (default = java.lang.IllegalStateException)

deploy - deploy resource from repository
   scope: obr
   flags:
      -s, --start   start deployed bundles
   parameters:
      String[]   ( <bundle-name> | <symbolic-name> | <bundle-id> )[@<version>] ...

un - uninstall the specified bundle(s)
   scope: equinox
   parameters:
      Bundle[]   bundle(s) to uninstall

install - install and optionally start bundle from the given URL
   scope: equinox
   flags:
      -start   spedify if the bundle should be started after installation
   parameters:
      String   Location of bundle to install

up - update the specified bundle(s)
   scope: equinox
   parameters:
      Bundle[]   bundle(s) to update

up - Update the specified bundle from the specified location
   scope: equinox
   parameters:
      Bundle   Bundle to update
      URL   Location of the new bundle content

bundlelevel - query bundle start level
   scope: felix
   parameters:
      Bundle   bundle to query

bundlelevel - set bundle start level or initial bundle start level
   scope: felix
   flags:
      -i, --setinitial   set the initial bundle start level
      -s, --setlevel   set the bundle's start level
   parameters:
      int   target level
      Bundle[]   target identifiers

refresh - refresh bundles
   scope: felix
   parameters:
      Bundle[]   target bundles (can be null or empty)

bundles - display details for all installed bundles
   scope: equinox
   parameters:
      String[]   [-s <comma separated list of bundle states>] [segment of bsn]

services - display registered service details. Examples for [filter]: (objectClass=com.xyz.Person); (&(objectClass=com.xyz.Person)(sn=Jensen)); passing only com.xyz.Person is a shortcut for (objectClass=com.xyz.Person). The filter syntax specification is available at http://www.ietf.org/rfc/rfc1960.txt
   scope: equinox
   parameters:
      String[]   Optional filter for filtering the displayed services. Examples for the filter: (objectClass=com.xyz.Person); (&(objectClass=com.xyz.Person)(sn=Jensen)); passing only com.xyz.Person is a shortcut for (objectClass=com.xyz.Person). The filter syntax specification is available at http://www.ietf.org/rfc/rfc1960.txt

lb - list all installed bundles
   scope: felix
   flags:
      -l, --location   show location
      -s, --symbolicname   show symbolic name
      -u, --updatelocation   show update location

lb - list installed bundles matching a substring
   scope: felix
   flags:
      -l, --location   show location
      -s, --symbolicname   show symbolic name
      -u, --updatelocation   show update location
   parameters:
      String   subtring matched against name or symbolic name

headers - print bundle headers
   scope: equinox
   parameters:
      Bundle[]   bundles to print headers for

profilelog - Display & flush the profile log messages
   scope: equinox

uninstall - uninstall bundles
   scope: felix
   parameters:
      Bundle[]   target bundles

list - list repository resources
   scope: obr
   flags:
      -v, --verbose   display all versions
   parameters:
      String[]   optional strings used for name matching

headers - display bundle headers
   scope: felix
   parameters:
      Bundle[]   target bundles

ls - get current directory contents
   scope: felix
   parameters:
      CommandSession   automatically supplied shell session

ls - get specified path contents
   scope: felix
   parameters:
      CommandSession   automatically supplied shell session
      String   path with optionally wildcarded file name

setbsl - set the start level for the bundle(s)
   scope: equinox
   parameters:
      int   new start level
      Bundle[]   bundle(s) to change startlevel

uninstall - uninstall the specified bundle(s)
   scope: equinox
   parameters:
      Bundle[]   bundle(s) to uninstall

threads - display threads and thread groups
   scope: equinox

threads - stop the named thread with an IllegalStateException
   scope: equinox
   parameters:
      String   stop
      String   the thread on which to perform the action

threads - stop the named thread with the provided throwable
   scope: equinox
   parameters:
      String   stop
      String   the thread on which to perform the action
      Class   the class of the throwable to throw (default = java.lang.IllegalStateException)

requiredBundles - lists required bundles having the specified symbolic name
   scope: equinox
   parameters:
      String[]   symbolic name for required bundles to be listed; if not specified all required bundles will be listed

setfwsl - set the framework start level
   scope: equinox
   parameters:
      int   new start level

javadoc - retrieve resource JavaDoc from repository
   scope: obr
   flags:
      -x, --extract   extract documentation
   parameters:
      File   local target directory
      String[]   ( <bundle-name> | <symbolic-name> | <bundle-id> )[@<version>] ...

getprop - displays the system properties with the given name, or all of them
   scope: equinox
   parameters:
      String[]   name of system property to dispaly

stop - stop the specified bundle(s)
   scope: equinox
   parameters:
      Bundle[]   bundle(s) to stop

ss - display installed bundles (short status)
   scope: equinox
   parameters:
      String[]   [-s <comma separated list of bundle states>] [segment of bsn]

repos - manage repositories
   scope: obr
   parameters:
      String   ( add | list | refresh | remove )
      String[]   space-delimited list of repository URLs

cd - get current directory
   scope: felix
   parameters:
      CommandSession   automatically supplied shell session

cd - change current directory
   scope: felix
   parameters:
      CommandSession   automatically supplied shell session
      String   target directory

tac
   scope: gogo
   parameters:
      CommandSession  
      String[]  

sl - display the start level for the specified bundle, or for the framework if no bundle specified
   scope: equinox
   parameters:
      Bundle[]   bundle to get the start level

telnetd
   scope: gogo
   parameters:
      String[]  

sta - start the specified bundle(s)
   scope: equinox
   parameters:
      Bundle[]   bundle(s) to start

inspect - inspects bundle dependency information
   scope: felix
   parameters:
      String   (package | bundle | fragment | service)
      String   (capability | requirement)
      Bundle[]   target bundles

init - uninstall all bundles
   scope: equinox

se - display registered service details. Examples for [filter]: (objectClass=com.xyz.Person); (&(objectClass=com.xyz.Person)(sn=Jensen)); passing only com.xyz.Person is a shortcut for (objectClass=com.xyz.Person). The filter syntax specification is available at http://www.ietf.org/rfc/rfc1960.txt
   scope: equinox
   parameters:
      String[]   Optional filter for filtering the displayed services. Examples for the filter: (objectClass=com.xyz.Person); (&(objectClass=com.xyz.Person)(sn=Jensen)); passing only com.xyz.Person is a shortcut for (objectClass=com.xyz.Person). The filter syntax specification is available at http://www.ietf.org/rfc/rfc1960.txt

set
   scope: gogo
   parameters:
      CommandSession  
      String[]  

disabledBundles - List disabled bundles in the system
   scope: equinox

type
   scope: gogo
   parameters:
      CommandSession  
      String[]  

source - retrieve resource source code from repository
   scope: obr
   flags:
      -x, --extract   extract source code
   parameters:
      File   local target directory
      String[]   ( <bundle-name> | <symbolic-name> | <bundle-id> )[@<version>] ...

info - retrieve resource description from repository
   scope: obr
   parameters:
      String[]   ( <bundle-name> | <symbolic-name> | <bundle-id> )[@<version>] ...

b - display details for the specified bundle(s)
   scope: equinox
   parameters:
      Bundle[]   (<id>|<location>)

frameworklevel - query framework active start level
   scope: felix

frameworklevel - set framework active start level
   scope: felix
   parameters:
      int   target start level

disconnect
   scope: equinox
   parameters:
      CommandSession  

pr - Display system properties
   scope: equinox

telnet - start/stop a telnet server
   scope: equinox
   parameters:
      String[]  

update - update bundle
   scope: felix
   parameters:
      Bundle   target bundle

update - update bundle from URL
   scope: felix
   parameters:
      Bundle   target bundle
      String   URL from where to retrieve bundle

packages - display imported/exported package details
   scope: equinox
   parameters:
      Bundle[]   Bundle whose packages to display. If not present displays all exported packages

packages - display imported/exported package details
   scope: equinox
   parameters:
      String   Package name of the package to display

refresh - refresh the packages of the specified bundles; if -all option is specified refresh packages of all installed bundles
   scope: equinox
   flags:
      -all   specify to refresh the packages of all installed bundles
   parameters:
      Bundle[]   list of bundles whose packages to be refreshed; if not present refreshes all bundles

shutdown - shutdown the OSGi Framework
   scope: equinox

format
   scope: gogo
   parameters:
      CommandSession  

format
   scope: gogo
   parameters:
      CommandSession  
      Object  

help
   scope: equinox
   parameters:
      CommandSession  
      String[]  

setibsl - set the initial bundle start level
   scope: equinox
   parameters:
      int   new start level

exit - exit immediately (System.exit)
   scope: equinox

man
   scope: equinox
   parameters:
      CommandSession  
      String[]  

diag - Displays unsatisfied constraints for the specified bundle(s)
   scope: equinox
   parameters:
      long[]   IDs of bundle(s), for which to display unsatisfied constraints

help - displays available commands
   scope: felix

help - displays information about a specific command
   scope: felix
   parameters:
      String   target command

grep
   scope: gogo
   parameters:
      CommandSession  
      String[]  

each
   scope: gogo
   parameters:
      CommandSession  
      Collection  
      Function  

source
   scope: gogo
   parameters:
      CommandSession  
      String  

resolve - resolve bundles
   scope: felix
   parameters:
      Bundle[]   target bundles (can be null or empty)

echo
   scope: gogo
   parameters:
      Object[]  

not
   scope: gogo
   parameters:
      CommandSession  
      Function  

cat
   scope: gogo
   parameters:
      CommandSession  
      String[]  

gc - perform a garbage collection
   scope: equinox

start - start the specified bundle(s)
   scope: equinox
   parameters:
      Bundle[]   bundle(s) to start

stop - stop bundles
   scope: felix
   flags:
      -t, --transient   stop bundle transiently
   parameters:
      Bundle[]   target bundles

gosh
   scope: gogo
   parameters:
      CommandSession  
      String[]  

getPackages - lists all packages visible from the specified bundle
   scope: equinox
   parameters:
      Bundle   bundle to list the visible packages

exec - execute a command in a separate process and wait
   scope: equinox
   parameters:
      String   command to be executed

which - determines from where a bundle loads a class
   scope: felix
   parameters:
      Bundle   target bundle
      String   target class name

until
   scope: gogo
   parameters:
      CommandSession  
      Function  
      Function  

close - shutdown and exit
   scope: equinox

update - update the specified bundle(s)
   scope: equinox
   parameters:
      Bundle[]   bundle(s) to update

update - Update the specified bundle from the specified location
   scope: equinox
   parameters:
      Bundle   Bundle to update
      URL   Location of the new bundle content

setprop - set OSGi properties
   scope: equinox
   parameters:
      String[]   list of properties with values to be set; the format is <key>=<value> and the pairs are separated with space if more than one

classSpaces - lists required bundles having the specified symbolic name
   scope: equinox
   parameters:
      String[]   symbolic name for required bundles to be listed; if not specified all required bundles will be listed

bundle - display details for the specified bundle(s)
   scope: equinox
   parameters:
      Bundle[]   (<id>|<location>)

status - display installed bundles and registered services
   scope: equinox
   parameters:
      String[]   [-s <comma separated list of bundle states>] [segment of bsn]

setp - set OSGi properties
   scope: equinox
   parameters:
      String[]   list of properties with values to be set; the format is <key>=<value> and the pairs are separated with space if more than one

sh
   scope: gogo
   parameters:
      CommandSession  
      String[]  

Equinox 3.8.2 OSGi commands page .....


bundlelevel - query bundle start level
   scope: felix
   parameters:
      Bundle   bundle to query

bundlelevel - set bundle start level or initial bundle start level
   scope: felix
   flags:
      -i, --setinitial   set the initial bundle start level
      -s, --setlevel   set the bundle's start level
   parameters:
      int   target level
      Bundle[]   target identifiers

frameworklevel - query framework active start level
   scope: felix

frameworklevel - set framework active start level
   scope: felix
   parameters:
      int   target start level

headers - display bundle headers
   scope: felix
   parameters:
      Bundle[]   target bundles

help - displays available commands
   scope: felix

help - displays information about a specific command
   scope: felix
   parameters:
      String   target command

install - install bundle using URLs
   scope: felix
   parameters:
      String[]   target URLs

inspect - inspects bundle dependency information
   scope: felix
   parameters:
      String   (package | bundle | fragment | service)
      String   (capability | requirement)
      Bundle[]   target bundles

lb - list all installed bundles
   scope: felix
   flags:
      -l, --location   show location
      -s, --symbolicname   show symbolic name
      -u, --updatelocation   show update location

lb - list installed bundles matching a substring
   scope: felix
   flags:
      -l, --location   show location
      -s, --symbolicname   show symbolic name
      -u, --updatelocation   show update location
   parameters:
      String   subtring matched against name or symbolic name

log - display all matching log entries
   scope: felix
   parameters:
      String   minimum log level [ debug | info | warn | error ]

log - display some matching log entries
   scope: felix
   parameters:
      int   maximum number of entries
      String   minimum log level [ debug | info | warn | error ]

refresh - refresh bundles
   scope: felix
   parameters:
      Bundle[]   target bundles (can be null or empty)

resolve - resolve bundles
   scope: felix
   parameters:
      Bundle[]   target bundles (can be null or empty)

start - start bundles
   scope: felix
   flags:
      -p, --policy   use declared activation policy
      -t, --transient   start bundle transiently
   parameters:
      String[]   target bundle identifiers or URLs

stop - stop bundles
   scope: felix
   flags:
      -t, --transient   stop bundle transiently
   parameters:
      Bundle[]   target bundles

uninstall - uninstall bundles
   scope: felix
   parameters:
      Bundle[]   target bundles

update - update bundle
   scope: felix
   parameters:
      Bundle   target bundle

update - update bundle from URL
   scope: felix
   parameters:
      Bundle   target bundle
      String   URL from where to retrieve bundle

which - determines from where a bundle loads a class
   scope: felix
   parameters:
      Bundle   target bundle
      String   target class name

cd - get current directory
   scope: felix
   parameters:
      CommandSession   automatically supplied shell session

cd - change current directory
   scope: felix
   parameters:
      CommandSession   automatically supplied shell session
      String   target directory

ls - get current directory contents
   scope: felix
   parameters:
      CommandSession   automatically supplied shell session

ls - get specified path contents
   scope: felix
   parameters:
      CommandSession   automatically supplied shell session
      String   path with optionally wildcarded file name

deploy - deploy resource from repository
   scope: obr
   flags:
      -s, --start   start deployed bundles
   parameters:
      String[]   ( <bundle-name> | <symbolic-name> | <bundle-id> )[@<version>] ...

info - retrieve resource description from repository
   scope: obr
   parameters:
      String[]   ( <bundle-name> | <symbolic-name> | <bundle-id> )[@<version>] ...

javadoc - retrieve resource JavaDoc from repository
   scope: obr
   flags:
      -x, --extract   extract documentation
   parameters:
      File   local target directory
      String[]   ( <bundle-name> | <symbolic-name> | <bundle-id> )[@<version>] ...

list - list repository resources
   scope: obr
   flags:
      -v, --verbose   display all versions
   parameters:
      String[]   optional strings used for name matching

repos - manage repositories
   scope: obr
   parameters:
      String   ( add | list | refresh | remove )
      String[]   space-delimited list of repository URLs

source - retrieve resource source code from repository
   scope: obr
   flags:
      -x, --extract   extract source code
   parameters:
      File   local target directory
      String[]   ( <bundle-name> | <symbolic-name> | <bundle-id> )[@<version>] ...

format
   scope: gogo
   parameters:
      CommandSession  

format
   scope: gogo
   parameters:
      CommandSession  
      Object  

getopt
   scope: gogo
   parameters:
      List  
      Object[]  

set
   scope: gogo
   parameters:
      CommandSession  
      String[]  

tac
   scope: gogo
   parameters:
      CommandSession  
      String[]  

type
   scope: gogo
   parameters:
      CommandSession  
      String[]  

each
   scope: gogo
   parameters:
      CommandSession  
      Collection  
      Function  

not
   scope: gogo
   parameters:
      CommandSession  
      Function  

until
   scope: gogo
   parameters:
      CommandSession  
      Function  
      Function  

cat
   scope: gogo
   parameters:
      CommandSession  
      String[]  

echo
   scope: gogo
   parameters:
      Object[]  

grep
   scope: gogo
   parameters:
      CommandSession  
      String[]  

telnetd
   scope: gogo
   parameters:
      String[]  

gosh
   scope: gogo
   parameters:
      CommandSession  
      String[]  

sh
   scope: gogo
   parameters:
      CommandSession  
      String[]  

source
   scope: gogo
   parameters:
      CommandSession  
      String  

telnet - start/stop a telnet server
   scope: equinox
   parameters:
      String[]  

exit - exit immediately (System.exit)
   scope: equinox

shutdown - shutdown the OSGi Framework
   scope: equinox

sta - start the specified bundle(s)
   scope: equinox
   parameters:
      Bundle[]   bundle(s) to start

start - start the specified bundle(s)
   scope: equinox
   parameters:
      Bundle[]   bundle(s) to start

sto - stop the specified bundle(s)
   scope: equinox
   parameters:
      Bundle[]   bundle(s) to stop

stop - stop the specified bundle(s)
   scope: equinox
   parameters:
      Bundle[]   bundle(s) to stop

i - install and optionally start bundle from the given URL
   scope: equinox
   flags:
      -start   spedify if the bundle should be started after installation
   parameters:
      String   Location of bundle to install

install - install and optionally start bundle from the given URL
   scope: equinox
   flags:
      -start   spedify if the bundle should be started after installation
   parameters:
      String   Location of bundle to install

up - update the specified bundle(s)
   scope: equinox
   parameters:
      Bundle[]   bundle(s) to update

up - Update the specified bundle from the specified location
   scope: equinox
   parameters:
      Bundle   Bundle to update
      URL   Location of the new bundle content

update - update the specified bundle(s)
   scope: equinox
   parameters:
      Bundle[]   bundle(s) to update

update - Update the specified bundle from the specified location
   scope: equinox
   parameters:
      Bundle   Bundle to update
      URL   Location of the new bundle content

un - uninstall the specified bundle(s)
   scope: equinox
   parameters:
      Bundle[]   bundle(s) to uninstall

uninstall - uninstall the specified bundle(s)
   scope: equinox
   parameters:
      Bundle[]   bundle(s) to uninstall

s - display installed bundles and registered services
   scope: equinox
   parameters:
      String[]   [-s <comma separated list of bundle states>] [segment of bsn]

status - display installed bundles and registered services
   scope: equinox
   parameters:
      String[]   [-s <comma separated list of bundle states>] [segment of bsn]

se - display registered service details. Examples for [filter]: (objectClass=com.xyz.Person); (&(objectClass=com.xyz.Person)(sn=Jensen)); passing only com.xyz.Person is a shortcut for (objectClass=com.xyz.Person). The filter syntax specification is available at http://www.ietf.org/rfc/rfc1960.txt
   scope: equinox
   parameters:
      String[]   Optional filter for filtering the displayed services. Examples for the filter: (objectClass=com.xyz.Person); (&(objectClass=com.xyz.Person)(sn=Jensen)); passing only com.xyz.Person is a shortcut for (objectClass=com.xyz.Person). The filter syntax specification is available at http://www.ietf.org/rfc/rfc1960.txt

services - display registered service details. Examples for [filter]: (objectClass=com.xyz.Person); (&(objectClass=com.xyz.Person)(sn=Jensen)); passing only com.xyz.Person is a shortcut for (objectClass=com.xyz.Person). The filter syntax specification is available at http://www.ietf.org/rfc/rfc1960.txt
   scope: equinox
   parameters:
      String[]   Optional filter for filtering the displayed services. Examples for the filter: (objectClass=com.xyz.Person); (&(objectClass=com.xyz.Person)(sn=Jensen)); passing only com.xyz.Person is a shortcut for (objectClass=com.xyz.Person). The filter syntax specification is available at http://www.ietf.org/rfc/rfc1960.txt

p - display imported/exported package details
   scope: equinox
   parameters:
      Bundle[]   Bundle whose packages to display. If not present displays all exported packages

p - display imported/exported package details
   scope: equinox
   parameters:
      String   Package name of the package to display

packages - display imported/exported package details
   scope: equinox
   parameters:
      Bundle[]   Bundle whose packages to display. If not present displays all exported packages

packages - display imported/exported package details
   scope: equinox
   parameters:
      String   Package name of the package to display

bundles - display details for all installed bundles
   scope: equinox
   parameters:
      String[]   [-s <comma separated list of bundle states>] [segment of bsn]

b - display details for the specified bundle(s)
   scope: equinox
   parameters:
      Bundle[]   (<id>|<location>)

bundle - display details for the specified bundle(s)
   scope: equinox
   parameters:
      Bundle[]   (<id>|<location>)

gc - perform a garbage collection
   scope: equinox

init - uninstall all bundles
   scope: equinox

close - shutdown and exit
   scope: equinox

r - refresh the packages of the specified bundles; if -all option is specified refresh packages of all installed bundles
   scope: equinox
   flags:
      -all   specify to refresh the packages of all installed bundles
   parameters:
      Bundle[]   list of bundles whose packages to be refreshed; if not present refreshes all bundles

refresh - refresh the packages of the specified bundles; if -all option is specified refresh packages of all installed bundles
   scope: equinox
   flags:
      -all   specify to refresh the packages of all installed bundles
   parameters:
      Bundle[]   list of bundles whose packages to be refreshed; if not present refreshes all bundles

exec - execute a command in a separate process and wait
   scope: equinox
   parameters:
      String   command to be executed

fork - execute a command in a separate process
   scope: equinox
   parameters:
      String   command to be executed

h - print bundle headers
   scope: equinox
   parameters:
      Bundle[]   bundles to print headers for

headers - print bundle headers
   scope: equinox
   parameters:
      Bundle[]   bundles to print headers for

pr - Display system properties
   scope: equinox

props - Display system properties
   scope: equinox

setp - set OSGi properties
   scope: equinox
   parameters:
      String[]   list of properties with values to be set; the format is <key>=<value> and the pairs are separated with space if more than one

setprop - set OSGi properties
   scope: equinox
   parameters:
      String[]   list of properties with values to be set; the format is <key>=<value> and the pairs are separated with space if more than one

ss - display installed bundles (short status)
   scope: equinox
   parameters:
      String[]   [-s <comma separated list of bundle states>] [segment of bsn]

t - display threads and thread groups
   scope: equinox

threads - display threads and thread groups
   scope: equinox

sl - display the start level for the specified bundle, or for the framework if no bundle specified
   scope: equinox
   parameters:
      Bundle[]   bundle to get the start level

setfwsl - set the framework start level
   scope: equinox
   parameters:
      int   new start level

setbsl - set the start level for the bundle(s)
   scope: equinox
   parameters:
      int   new start level
      Bundle[]   bundle(s) to change startlevel

setibsl - set the initial bundle start level
   scope: equinox
   parameters:
      int   new start level

profilelog - Display & flush the profile log messages
   scope: equinox

getprop - displays the system properties with the given name, or all of them
   scope: equinox
   parameters:
      String[]   name of system property to dispaly

diag - Displays unsatisfied constraints for the specified bundle(s)
   scope: equinox
   parameters:
      long[]   IDs of bundle(s), for which to display unsatisfied constraints

help
   scope: equinox
   parameters:
      CommandSession  
      String[]  

man
   scope: equinox
   parameters:
      CommandSession  
      String[]  

disconnect
   scope: equinox
   parameters:
      CommandSession 

Run Eclipse Equinox (3.9 or 3.8) with minimum bundles (jars) .......

Following is how you can run equinox framework version 3.8 with minimum bundles. This is valid for 3.9 version too.(Note you need to use compatible felix bundles with 3.9 framework) 

Step 1:Download and put following 5 bundles to a directory

1. org.eclipse.osgi_3.8.2.v<version>.jar    - Equinox framework bundle 

From equinox 3.8, framework bundle don't has console it self, we need to provide felix console bundles to run osgi console commands.

2. org.apache.felix.gogo.command_0.8.0.v<version>.jar
3. org.apache.felix.gogo.runtime_0.8.0.v<version>.jar
4. org.apache.felix.gogo.shell_0.8.0.v<version>.jar

 This is optional , without following jar still you will get osgi console but you can't run, osgi command like 'ss' 'ls' etc.. you can use only command limited felix and gogo scopes like, felix:<command> and gogo:<command>.

5.org.eclipse.equinox.console_1.0.0.v<version>.jar

Step 2 : open the terminal and go to above directory and run following command.
'java -Dosgi.bundles=org.apache.felix.gogo.command_0.8.0.v<version>.jar@start,org.apache.felix.gogo.shell_0.8.0.v<version>.jar@start,org.apache.felix.gogo.runtime_0.8.0.v<version>.jar@start,org.eclipse.equinox.console_1.0.0.v<version>.jar@start -jar org.eclipse.osgi_3.8.2.v<version>.jar -console'

You will see "osgi>" in terminal, if so here we go we are in osgi console, now you can run osgi commands. Type help on osgi console or check this post to find all available osgi commands or this for 3.9.1 commands

Sunday, December 1, 2013

'JavaScript and JSON Essentials' : The second book I reviewed is now published in PacktPub


Few months ago i received an invitation from Packt Publishing to review the book 'Instant GSON Starter' which is a comprehensive guide on getting start with Google GSON library. I have previously worked with gson in the last few years during Google Summer of Code programme when i was an undergrad student therefore it was a great experience for me reviewing a tech book for the first time, as the technical reviewer.


The book 'JavaScript and JSON Essentials' is the second book which i got the opportunity to review recently after starting my career as a Software Engineer. As it is described in the book, 'JavaScript and JSON Essentials' is a step-by-step guide that will introduce you to JSON and help you understand how the lightweight JSON data format can be used in different ways either to store data locally or to transfer data over the Internet. This book will teach you how to use JSON effectively with JavaScript. The book is written in a manner that it provides a detailed introduction into each and every section as well as it provides examples in a tutorial-based approach. Therefore even for a novice it would be easy to learn and follow the examples given in the book in order to get familiarized with JavaScript and JSON.

The book is written by Sai Srinivas Sriparasa. It is currently published in the PacktPub catalogue and can be purchased via the link here.

Sunday, August 11, 2013

[Webinar] How to build a custom stack with WSO2 Carbon

I have conducted a webinar on the topic mentioned above by few weeks ago, dated Wednesday 24th July 2013. The presenters were my self and Ananda Manoj and the webinar was mainly focused on discussing how to combine and use the various features  of the WSO2 Carbon platform to suit an organization's middleware needs.

WSO2 Carbon middleware stack consists of more than a 175 OSGi-based components. Even though WSO2 Carbon ships some of the well defined component configurations as a set of products,  it is also possible for organizations to come up with their own product configurations through a mix and match of available components with WSO2 Carbon. Our webinar, which was the final one of the 'Carbon Webinar Series' was conducted in explaining how to create a customized stack with WSO2 Carbon with including a step by step guide and a live demonstration on how to create a custom component.

First let's know the key points that were highlighted in webinar.

•  The feature/component concept in the WSO2 Carbon platform.
•  Installing features using the Feature Manager.
•  How to create your custom products for cluster wide deployment.
•  Configuring logs/adding configs etc.

In the next paragraphs i am going to brief on what exactly is discussed from each point here.

•  The feature/component concept in the WSO2 Carbon platform
Component is simple a OSGi bundle. This is what we develop. Carbon component should follow the rules define in carbon framework. Component has a core runtime which will provide a clean SOA management interface. There are two type of components Back-end component and Front-end component. All bussiness logic goes to back end component while front-end component have all client side code.  A component can use core Carbon services like Registry Service, UserManager Service etc... via OSGi services registry.

In Carbon world feature is an installable unit. This is what we install on Carbon. A feature has one or more logically related Carbon components. We can write an aggregate feature which has two or more features with it. This features can be installed into Carbon base products using feature Manager service, provided by Carbon Framework.
   
•  Installing features using the Feature Manager
As mentioned in above there is a feature manager service which provides nice and easy way to install features on Carbon based products. This feature manager supports all feature provisioning works in runtime like install/uninstall features etc. Once you installed the new features to your Carbon based product you must restart the system to active them. Using Feature Manager you can install features only in runtime but if you need to install your custom features in build time you can do that using Carbon p2 maven plugin. It is just needed to add that plugin to your pom.xml file with few configurations.   

•  How to create your custom products for cluster wide deployment
In productions you may need to scale up and down your system or avoid single point of failure using two or more instance in runtime. One way to do this is cluster your runtime instances and expose it as a single service. For that your product should have clustering capabilites with it, Carbon kernel provides clustering support for all products which are build on top of that. It means if you build your custom products on top of Carbon you will get the culstering capability for your product. Another barrier is volume, reality is even you start your product with low number of requests per sec, with the growth of the business you may need handle large number or request per sec. One way to handle this is use caching. With caching you can store state less data used in requests other than using back end database. Where do we need to store and retrive the same data per reqeust? As you know a database call is very expensive. Therefore caching is the best solution for that kind of situation. Carbon kernel it self comes up with Caching implentation, not only local caching it provide distribute caching too. Like wise you will get advanced features like depsync, GostDeployment capabilities too.

•  Configuring logs/adding configs etc.
Carbon Framework is a customizable framework as it provides number of configuration files to customize the runtime behavior. All configuration file are placed under <CARBON_HOME>/repository/conf directory. Following are the set of important configuration files.

  • axis2.xml  - Use for configure MessageBuilders, MessageFormatters , Clustering etc ...
  • carbon.xml - Use for configure Ports, KeyStores , DeploymentSynchronizer , JNDI etc ...
  • catalina-server.xml - Use for configure TransportListners and TransportSenders, Tomcat valves
  • registry.xml - All registry related configurations.
  • log4j.properties - All log related properties
  • master-datasources.xml - All datasource related configurations.

This webinar was mainly targetted the audience who are interested in,
• Customizing existing WSO2 Carbon servers with additional components.
• Scripting feature installations for automated deployment in a clustered environment.
• Configuring Carbon servers for optimal performance.
 If you belong to any of these categories, it will be worth your time watching it from the link below.

To watch the recording or read the slides used in webinar, goto the official link from here.....
To read the presentation in SlideShare, visit here ...
To download Student Manager sample click here ...

Sample Text

Website counter

Categories