Top Inners Fields Constructors Methods
org.glassfish.gmbal.main

public Class ProfileMain

extends Object
Class Inheritance
Imports
java.io.IOException, java.util.ArrayList, .HashMap, .HashSet, .List, .Map, .Random, .Set, javax.management.ObjectName, org.glassfish.gmbal.Description, .ManagedAttribute, .ManagedData, .ManagedObjectManagerFactory, .ManagedObjectManager, .ManagedObject, .NameValue, .AMXClient, org.glassfish.pfl.basic.contain.Pair

Author
ken

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class
public static class
public static class

Field Summary

Modifier and TypeField and Description
private static final String[]
private static final ProfileMain.Item[]
private static ManagedObjectManager
private static final int
private static final Random

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static void
private static void
public static void
main(String[] args)

private static void
msg(String arg)

private static void
public static void
run(boolean isWarmup, int count)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

itemNamesback to summary
private static final String[] itemNames
itemsback to summary
private static final ProfileMain.Item[] items
momback to summary
private static ManagedObjectManager mom
NUM_STORESback to summary
private static final int NUM_STORES
randomback to summary
private static final Random random

Constructor Detail

ProfileMainback to summary
public ProfileMain()

Method Detail

checkAttributesback to summary
private static void checkAttributes(ManagedObjectManager mom, ProfileMain.MyRoot myroot)
initializeStoresback to summary
private static void initializeStores(ProfileMain.MyRoot myroot)
mainback to summary
public static void main(String[] args) throws IOException
msgback to summary
private static void msg(String arg)
registerMBeansback to summary
private static void registerMBeans(ManagedObjectManager mom, ProfileMain.MyRoot myroot)
runback to summary
public static void run(boolean isWarmup, int count) throws IOException
org.glassfish.gmbal.main back to summary

public Class ProfileMain.Item

extends Object
Class Inheritance
Annotations
@ManagedData

Field Summary

Modifier and TypeField and Description
private double
private String
private double

Constructor Summary

AccessConstructor and Description
public
Item(String name, double size, double mass)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object obj)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

pack-priv double
mass()

pack-priv String
name()

pack-priv double
size()

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

massback to summary
private double mass
nameback to summary
private String name
Annotations
@ManagedAttribute
sizeback to summary
private double size

Constructor Detail

Itemback to summary
public Item(String name, double size, double mass)

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
massback to summary
pack-priv double mass()
Annotations
@ManagedAttribute
@Description:The mass of this entity
nameback to summary
pack-priv String name()
Annotations
@Description:The name of this entity
@NameValue
sizeback to summary
pack-priv double size()
Annotations
@ManagedAttribute
@Description:The size of this entity
org.glassfish.gmbal.main back to summary

public Class ProfileMain.MyRoot

extends Object
Class Inheritance
Annotations
@ManagedObject

Field Summary

Modifier and TypeField and Description
private List<ProfileMain.Item>
private List<ProfileMain.Store>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
pack-priv Map<ProfileMain.Item, Set<ProfileMain.Store>>
pack-priv List<ProfileMain.Item>
pack-priv List<ProfileMain.Store>
pack-priv String
name()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

itemsback to summary
private List<ProfileMain.Item> items
storesback to summary
private List<ProfileMain.Store> stores

Constructor Detail

MyRootback to summary
public MyRoot()

Method Detail

addItemback to summary
public void addItem(ProfileMain.Item item)
addStoreback to summary
public void addStore(ProfileMain.Store store)
getItemLocationsback to summary
pack-priv Map<ProfileMain.Item, Set<ProfileMain.Store>> getItemLocations()
Annotations
@ManagedAttribute
@Description:Map of which stores contain a particular item
getItemsback to summary
pack-priv List<ProfileMain.Item> getItems()
Annotations
@ManagedAttribute
@Description:All possible items
getStoresback to summary
pack-priv List<ProfileMain.Store> getStores()
Annotations
@ManagedAttribute
@Description:All of the stores
nameback to summary
pack-priv String name()
Annotations
@NameValue
org.glassfish.gmbal.main back to summary

public Class ProfileMain.Store

extends Object
Class Inheritance
Annotations
@ManagedObject
@Description:A store of items

Field Summary

Modifier and TypeField and Description
pack-priv Map<ProfileMain.Item, Integer>
private String

Constructor Summary

AccessConstructor and Description
public
Store(String name)

Method Summary

Modifier and TypeMethod and Description
public void
addItem(ProfileMain.Item item, int count)

public boolean
equals(Object obj)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

pack-priv Map<ProfileMain.Item, Integer>
pack-priv String
name()

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

contentsback to summary
pack-priv Map<ProfileMain.Item, Integer> contents
nameback to summary
private String name

Constructor Detail

Storeback to summary
public Store(String name)

Method Detail

addItemback to summary
public void addItem(ProfileMain.Item item, int count)
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
inventoryback to summary
pack-priv Map<ProfileMain.Item, Integer> inventory()
Annotations
@ManagedAttribute
@Description:The number of items in the store
nameback to summary
pack-priv String name()
Annotations
@NameValue
@ManagedAttribute
@Description:The name of the store
org.glassfish.gmbal.main back to summary

public Class ProfileMain.Timings

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private List<Pair<String, Long>>
private long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
add(String msg)

public void
dump(String msg)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

durationsback to summary
private List<Pair<String, Long>> durations
startback to summary
private long start

Constructor Detail

Timingsback to summary
public Timings()

Method Detail

addback to summary
public void add(String msg)
dumpback to summary
public void dump(String msg)