net.sf.sail.core.util
Class PodUtils

java.lang.Object
  extended by net.sf.sail.core.util.PodUtils

public class PodUtils
extends java.lang.Object

Utility methods for working with beans (e.g. rims) in pods.

Author:
turadg

Constructor Summary
PodUtils()
           
 
Method Summary
static
<T> java.util.Collection<T>
childrenOfType(Curnit assembledCurnit, java.lang.Class<T> type)
           
static java.util.Collection<Rim> collectRimsInSamePod(java.lang.Object source)
          Collect the rims that are in the same pod as the source bean
static
<T extends ITitleAware>
T
createBeanInPod(Pod pod, java.lang.Class<T> beanClass, java.lang.String title)
          Create a bean of type beanClass, give it the title title, and store it in pod pod
static
<T> Rim<T>
createRimInPod(Pod pod, java.lang.Class<T> shape, java.lang.String rimName)
          Helper method to create in the pod a rim of the given name and shape
static Pod nextPod(java.lang.String pre, java.lang.String middle)
          Deprecated. 
static void printPodTree(java.io.PrintStream out, int indent, Pod pod)
           
static Pod resolvePod(java.lang.Object source)
          Helper method to find the pod containing the source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PodUtils

public PodUtils()
Method Detail

childrenOfType

public static <T> java.util.Collection<T> childrenOfType(Curnit assembledCurnit,
                                                         java.lang.Class<T> type)
Type Parameters:
T -
Parameters:
assembledCurnit -
type -
Returns:
a collection of the elements of assembledCurnit that are type type

createBeanInPod

public static <T extends ITitleAware> T createBeanInPod(Pod pod,
                                                        java.lang.Class<T> beanClass,
                                                        java.lang.String title)
                                             throws java.lang.InstantiationException,
                                                    java.lang.IllegalAccessException
Create a bean of type beanClass, give it the title title, and store it in pod pod

Type Parameters:
T -
Parameters:
pod - pod to store the bean in
beanClass - type of bean to create
title - title to give the bean
Returns:
the bean created
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException

nextPod

@Deprecated
public static Pod nextPod(java.lang.String pre,
                                     java.lang.String middle)
Deprecated. 

Helper method to generate a new pod with an id unique within this JVM Tacks on a random number in the last 12 digits. -----PRE------ INDEX MIDDLE ---RANDOM--- aaaaaaaa-1111- 2222 -3333- 444444444444

Parameters:
pre -
middle -
Returns:
new pod id comprised of pre, a JVM serial number, middle, and random

createRimInPod

public static <T> Rim<T> createRimInPod(Pod pod,
                                        java.lang.Class<T> shape,
                                        java.lang.String rimName)
Helper method to create in the pod a rim of the given name and shape

Parameters:
pod -
shape -
rimName -
Returns:

collectRimsInSamePod

public static java.util.Collection<Rim> collectRimsInSamePod(java.lang.Object source)
Collect the rims that are in the same pod as the source bean

Parameters:
source -

resolvePod

public static Pod resolvePod(java.lang.Object source)
Helper method to find the pod containing the source. Checks that the parent BeanContext is of sub-type Pod.

Parameters:
source -
Returns:
Pod containing the source bean

printPodTree

public static void printPodTree(java.io.PrintStream out,
                                int indent,
                                Pod pod)


Copyright © 2004-2008 TELS Center. All Rights Reserved.