jrunx.ide.controller
Class JRunWizardManager

java.lang.Object
  |
  +--jrunx.ide.controller.JRunWizardManager
All Implemented Interfaces:
Constants

public class JRunWizardManager
extends java.lang.Object
implements Constants

The main class that is used by the view for performing all tasks.


Fields inherited from interface jrunx.ide.model.Constants
BEAN_TEMPLATE, BEANNAME, BEANTYPE, CONTEXT, FILE_SEP, HELP_ASSEMBLY, HELP_BEANSPECIFIC, HELP_CMPFIELDS, HELP_CMPMETHODS, HELP_CMPVARS, HELP_CONTTRANS, HELP_DATASOURCES, HELP_DEFAULT, HELP_DEPLOY, HELP_EJB, HELP_EJBGEN, HELP_EJBLOCALREF, HELP_EJBREF, HELP_ENVENTRY, HELP_METHPERM, HELP_PACKAGE, HELP_RELATIONSHIPS, HELP_RESOURCEENVREF, HELP_RESREF, HELP_SECREF, HELP_SECROLE, HOME_TEMPLATE, HOMENAME, JRUN_CMP_ACTIONS, JRUN_CMP_PROPERTY, JRUN_CMP_SERVER, NEWLINE, PACKAGE, REMOTE_TEMPLATE, REMOTENAME, USER_DIR, WILDCARD, WIZARDPROPS, WIZARDPROPSFILE
 
Constructor Summary
JRunWizardManager()
           
 
Method Summary
 void addModelListener(EJBModelListener lis)
           
 boolean beanClassExists(EJBean bean)
           
 void checkNull(java.lang.Object obj, java.lang.String resBundleException)
           
 EJBean createEJB(java.lang.String type)
          Create a new EJB
 void generateTemplateFiles(boolean overwrite)
          Generate template Java files for current Bean
 BeanMethod[] getBeanMethods(EJBean bean)
           
 CmpManager getCmpManager()
           
 EJBean getCurrentBean()
           
 Deployer getDeployer()
           
 EJBProject getEJBProject()
          Reference to model for current IDE Project.
 java.util.Vector getFiles(EJBean bean)
           
 Integrator getIntegrator()
           
static JRunWizardManager getJRunWizardManager()
           
 java.util.ArrayList getModelListeners()
           
 java.io.File getOutputDirectory()
           
 ServerManager getServerManager()
           
 java.io.File getSourceDirectory()
           
 java.lang.String getTemplateDirectory(EJBean bean)
           
 JRunWizardUI getWizardUI()
           
 boolean isBeanExists(EJBean bean)
           
 boolean isBeanNameUnique(java.lang.String name)
           
 boolean isCmp(EJBean bean)
           
 boolean isEntityBean(EJBean bean)
           
 boolean isLocal(EJBean bean)
           
 boolean isMessageBean(EJBean bean)
           
 boolean isRemote(EJBean bean)
           
 boolean isSessionBean(EJBean bean)
           
 JRunServer[] listServers()
           
 void prepareOpenDirectoryDeploy(java.io.File dir)
           
 void printTemporaryDD(java.io.File ejbJar, java.io.File jrunEjbJar, java.util.ArrayList beans)
           
 void removeCurrentBean()
          Remove current bean
 void removeModelListener(EJBModelListener lis)
           
 boolean sameAsCurrentProject(java.lang.String projName)
           
 void saveProject()
          Save the current changes to the ejb-jar.xml
 void setCurrentBean(EJBean currentBean)
           
 void setEJBProject(EJBProject ejbproject)
           
 void setIDEProject(java.lang.String name)
          This method uses the integrator to find the source and output directories, locates the ejb-jar.xml file ( if one exists ), and parses this file to load the EJBProject.
 void setIntegrator(Integrator ideIntegrator)
           
 void setWizardUI(JRunWizardUI wizardui)
          Set view
 boolean sourceExists()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JRunWizardManager

public JRunWizardManager()
Method Detail

getJRunWizardManager

public static JRunWizardManager getJRunWizardManager()

getOutputDirectory

public java.io.File getOutputDirectory()
                                throws IntegratorException

getSourceDirectory

public java.io.File getSourceDirectory()
                                throws IntegratorException

getIntegrator

public Integrator getIntegrator()

setIntegrator

public void setIntegrator(Integrator ideIntegrator)

getWizardUI

public JRunWizardUI getWizardUI()

setWizardUI

public void setWizardUI(JRunWizardUI wizardui)
Set view

getEJBProject

public EJBProject getEJBProject()
Reference to model for current IDE Project.

setEJBProject

public void setEJBProject(EJBProject ejbproject)

sameAsCurrentProject

public boolean sameAsCurrentProject(java.lang.String projName)

setIDEProject

public void setIDEProject(java.lang.String name)
                   throws IntegratorException,
                          JRunWizardException
This method uses the integrator to find the source and output directories, locates the ejb-jar.xml file ( if one exists ), and parses this file to load the EJBProject. Then it informs the UI about the new EJBProject object.
It is assumed that the ejb-jar.xml file is present under
Project Output Directory/meta-inf

If the above directory does not exist, then a directory is created. For projects with pre-existing EJB's, make sure that the above directory is present, so that the wizard locates all the EJB's.
It is the responsibility of the view to call this method when the IDE project changes.

createEJB

public EJBean createEJB(java.lang.String type)
                 throws JRunWizardException
Create a new EJB
Parameters:
type - One of DeploymentDescriptor.SESSION or DeploymentDescriptor.ENTITY

removeCurrentBean

public void removeCurrentBean()
Remove current bean

saveProject

public void saveProject()
                 throws JRunWizardException
Save the current changes to the ejb-jar.xml

generateTemplateFiles

public void generateTemplateFiles(boolean overwrite)
                           throws JRunWizardException,
                                  IntegratorException
Generate template Java files for current Bean
Parameters:
overwrite - If true, existing source will be overwritten, else a backup will be created if file exists.

sourceExists

public boolean sourceExists()
                     throws JRunWizardException,
                            IntegratorException

getCurrentBean

public EJBean getCurrentBean()

setCurrentBean

public void setCurrentBean(EJBean currentBean)

isBeanExists

public boolean isBeanExists(EJBean bean)

isBeanNameUnique

public boolean isBeanNameUnique(java.lang.String name)

beanClassExists

public boolean beanClassExists(EJBean bean)
                        throws JRunWizardException

getBeanMethods

public BeanMethod[] getBeanMethods(EJBean bean)
                            throws JRunWizardException

getFiles

public java.util.Vector getFiles(EJBean bean)
                          throws JRunWizardException

prepareOpenDirectoryDeploy

public void prepareOpenDirectoryDeploy(java.io.File dir)
                                throws java.lang.Exception

printTemporaryDD

public void printTemporaryDD(java.io.File ejbJar,
                             java.io.File jrunEjbJar,
                             java.util.ArrayList beans)
                      throws JRunWizardException

getTemplateDirectory

public java.lang.String getTemplateDirectory(EJBean bean)
                                      throws JRunWizardException,
                                             IntegratorException

addModelListener

public void addModelListener(EJBModelListener lis)

removeModelListener

public void removeModelListener(EJBModelListener lis)

getModelListeners

public java.util.ArrayList getModelListeners()

listServers

public JRunServer[] listServers()
                         throws java.io.FileNotFoundException,
                                JRunWizardException

getCmpManager

public CmpManager getCmpManager()

getDeployer

public Deployer getDeployer()

getServerManager

public ServerManager getServerManager()

checkNull

public void checkNull(java.lang.Object obj,
                      java.lang.String resBundleException)
               throws JRunWizardException

isCmp

public boolean isCmp(EJBean bean)

isMessageBean

public boolean isMessageBean(EJBean bean)

isSessionBean

public boolean isSessionBean(EJBean bean)

isEntityBean

public boolean isEntityBean(EJBean bean)

isLocal

public boolean isLocal(EJBean bean)

isRemote

public boolean isRemote(EJBean bean)


Copyright � 2002 Macromedia Corporation. All Rights Reserved.