:::: MENU ::::
Browsing posts in: java

Java HotSpot VM Options

This entry provides information on typical command-line options and environment variables that can affect the performance characteristics of the Java HotSpot Virtual Machine:

 

The link is here



Bean Scripting Framework

Bean Scripting Framework (BSF) is a set of Java classes which provides scripting language support within Java applications, and access to Java objects and methods from scripting languages. BSF allows one to write JSPs in languages other than Java while providing access to the Java class library. In addition, BSF permits any Java application to be implemented in part (or dynamically extended) by a language that is embedded within it. This is achieved by providing an API that permits calling scripting language engines from within Java, as well as an object registry that exposes Java objects to these scripting language engines.

 

BSF 2.x supports several scripting languages currently:

 

In addition, the following languages are supported with their own BSF engines:

Information on where to obtain scripting languages for use with BSF is available on the Related Projects page.


How to synchronize List, Set and Map elements?

Collections Java class provides methods to make List, Set or Map elements as synchronized:

public static List synchronizedList(List l){}

public static Set synchronizedSet(Set s){}

public static SortedSet synchronizedSortedSet(SortedSet s){}

public static Map synchronizedMap(Map m){}

public static SortedMap synchronizedSortedMap(SortedMap m){}

Here, you can find one example that uses synchronizedList

/*
 Get Synchronized List from Java ArrayList example
 This java example shows how to get a synchronized list from Java ArrayList using
 synchronizedList method of Collections class.
*/
 
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
 
public class GetSynchronizedListFromArrayListExample {
 
 public static void main(String[] args) {
 //create an ArrayList object
 ArrayList arrayList = new ArrayList();
 
 /*
 Java ArrayList is NOT synchronized. To get synchronized list from
 ArrayList use
 static void synchronizedList(List list) method of Collections class.
 */
 
 List list = Collections.synchronizedList(arrayList);
 
 /*
 Use this list object to prevent any unsynchronized access to original
 ArrayList object.
 */
 
 }
}

OO – Principles

When you are working on analysis, design and coding stuff, specifically on technologies like Java, it is important some aspects which you must keep in mind. These guidelines are useful and needful in order to create your architectures and designs by using the best practices such as follow design patterns as well of using OO principles. If you want to spend some minutes on OO Principles, please spend that time on the next page.

OO – Principles


Pages:1234567...17