1 7 package org.jboss.hibernate.jmx; 8 9 import java.io.File ; 10 import java.net.URL ; 11 import java.net.URLClassLoader ; 12 import java.util.Properties ; 13 import java.util.HashSet ; 14 import java.util.Iterator ; 15 import java.util.Date ; 16 import java.util.jar.JarFile ; 17 import javax.management.Notification ; 18 import javax.management.ObjectName ; 19 import javax.naming.InitialContext ; 20 import javax.naming.NamingException ; 21 22 import org.hibernate.HibernateException; 23 import org.hibernate.Interceptor; 24 import org.hibernate.SessionFactory; 25 import org.hibernate.jmx.StatisticsService; 26 import org.hibernate.cfg.Configuration; 27 import org.hibernate.cfg.Environment; 28 import org.hibernate.transaction.JBossTransactionManagerLookup; 29 import org.hibernate.transaction.JTATransactionFactory; 30 31 import org.jboss.hibernate.cache.DeployedTreeCacheProvider; 32 import org.jboss.hibernate.ListenerInjector; 33 import org.jboss.logging.Logger; 34 import org.jboss.naming.Util; 35 import org.jboss.system.ServiceMBeanSupport; 36 import org.jboss.deployment.DeploymentException; 37 import org.jboss.deployment.DeploymentInfo; 38 import org.jboss.mx.loading.RepositoryClassLoader; 39 40 49 public class Hibernate extends ServiceMBeanSupport implements HibernateMBean 50 { 51 52 private static final Logger log = Logger.getLogger( Hibernate.class ); 53 54 public static final String SESSION_FACTORY_CREATE = "hibernate.sessionfactory.create"; 55 public static final String SESSION_FACTORY_DESTROY = "hibernate.sessionfactory.destroy"; 56 57 private String datasourceName; 59 private String dialect; 60 private String defaultSchema; 61 private String defaultCatalog; 62 private Boolean sqlCommentsEnabled; 63 private Integer maxFetchDepth; 64 private Integer jdbcFetchSize; 65 private Integer jdbcBatchSize; 66 private Boolean batchVersionedDataEnabled; 67 private Boolean jdbcScrollableResultSetEnabled; 68 private Boolean getGeneratedKeysEnabled; 69 private Boolean streamsForBinaryEnabled; 70 private String hbm2ddlAuto; 71 private String querySubstitutions; 72 private Boolean showSqlEnabled; 73 private String username; 74 private String password; 75 private Boolean secondLevelCacheEnabled = Boolean.TRUE; 76 private Boolean queryCacheEnabled; 77 private String cacheProviderClass; 78 private ObjectName deployedTreeCacheObjectName; 79 private Boolean minimalPutsEnabled; 80 private String cacheRegionPrefix; 81 private Boolean structuredCacheEntriesEnabled; 82 private Boolean statGenerationEnabled; 83 private Boolean reflectionOptimizationEnabled; 84 85 private String sessionFactoryName; 87 private String sessionFactoryInterceptor; 88 private String listenerInjector; 89 private URL harUrl; 90 private boolean scanForMappingsEnabled = false; 91 private HashSet archiveClasspathUrls = new HashSet (); 92 private HashSet directoryClasspathUrls = new HashSet (); 93 94 private boolean dirty = false; 96 private Date runningSince; 97 private SessionFactory sessionFactory; 98 private ObjectName hibernateStatisticsServiceName; 99 100 103 public void startService() throws Exception 104 { 105 log.debug( "Hibernate MBean starting; " + this ); 106 107 if ( sessionFactory != null ) 109 { 110 destroySessionFactory(); 111 } 112 113 harUrl = determineHarUrl(); 114 115 if ( harUrl != null ) 116 { 117 log.trace( "starting in har deployment mode" ); 118 if ( scanForMappingsEnabled ) 120 { 121 log.trace( "scan for mappings was enabled" ); 122 scanForMappings(); 123 } 124 } 125 else 126 { 127 log.trace( "starting in non-har deployment mode" ); 129 scanForMappings(); 130 } 131 132 buildSessionFactory(); 133 } 134 135 138 public void stopService() throws Exception 139 { 140 destroySessionFactory(); 141 archiveClasspathUrls.clear(); 142 directoryClasspathUrls.clear(); 143 } 144 145 private URL determineHarUrl() throws Exception 146 { 147 log.trace( "Attempting to determine HarUrl..." ); 148 DeploymentInfo deploymentInfo = getDeploymentInfo(); 149 if ( deploymentInfo == null ) 150 { 151 log.warn( "Unable to locate deployment info [" + getServiceName() + "]" ); 152 return null; 153 } 154 155 String urlStr = deploymentInfo.url.getFile(); 156 log.trace( "checking our deployment unit [" + urlStr + "]" ); 157 if ( urlStr.endsWith( ".har" ) || urlStr.endsWith( ".har/" ) ) 158 { 159 return deploymentInfo.url; 160 } 161 else 162 { 163 return null; 164 } 165 } 166 167 172 private void buildSessionFactory() throws Exception 173 { 174 log.debug( "Building SessionFactory; " + this ); 175 176 Configuration cfg = new Configuration(); 177 cfg.getProperties().clear(); 179 ListenerInjector listenerInjector = generateListenerInjectorInstance(); 181 if ( listenerInjector != null ) 182 { 183 listenerInjector.injectListeners( getServiceName(), cfg ); 184 } 185 186 transferSettings( cfg.getProperties() ); 188 189 handleMappings( cfg ); 191 192 Interceptor interceptorInstance = generateInterceptorInstance(); 194 if ( interceptorInstance != null ) 195 { 196 cfg.setInterceptor( interceptorInstance ); 197 } 198 199 sessionFactory = cfg.buildSessionFactory(); 201 202 try 203 { 204 if ( sessionFactory.getStatistics() != null && sessionFactory.getStatistics().isStatisticsEnabled() ) 206 { 207 String serviceName = getServiceName().toString(); 208 if( serviceName.indexOf("type=service") != -1 ) 209 { 210 serviceName = serviceName.replaceAll("type=service","type=stats"); 211 } 212 else 213 { 214 serviceName = serviceName + ",type=stats"; 215 } 216 hibernateStatisticsServiceName = new ObjectName ( serviceName ); 217 StatisticsService hibernateStatisticsService = new StatisticsService(); 218 hibernateStatisticsService.setSessionFactory( sessionFactory ); 219 getServer().registerMBean( hibernateStatisticsService, hibernateStatisticsServiceName ); 220 } 221 222 bind(); 224 } 225 catch ( Exception e ) 226 { 227 forceCleanup(); 228 throw e; 229 } 230 231 dirty = false; 232 233 sendNotification( 234 new Notification ( SESSION_FACTORY_CREATE, getServiceName(), getNextNotificationSequenceNumber() ) 235 ); 236 237 runningSince = new Date (); 238 239 log.info( "SessionFactory successfully built and bound into JNDI [" + sessionFactoryName + "]" ); 240 } 241 242 247 private void destroySessionFactory() throws Exception 248 { 249 if ( sessionFactory != null ) 250 { 251 unbind(); 255 sessionFactory.close(); 256 sessionFactory = null; 257 runningSince = null; 258 259 if ( hibernateStatisticsServiceName != null ) 260 { 261 try 262 { 263 getServer().unregisterMBean( hibernateStatisticsServiceName ); 264 } 265 catch ( Throwable t ) 266 { 267 log.warn( "unable to cleanup statistics mbean", t ); 269 } 270 } 271 272 sendNotification( 273 new Notification ( SESSION_FACTORY_DESTROY, getServiceName(), getNextNotificationSequenceNumber() ) 274 ); 275 } 276 } 277 278 private void handleMappings(Configuration cfg) 279 { 280 if ( harUrl != null ) 281 { 282 final File file = new File ( harUrl.getFile() ); 283 if ( file.isDirectory() ) 284 { 285 cfg.addDirectory( file ); 286 } 287 else 288 { 289 cfg.addJar( file ); 290 } 291 } 292 293 Iterator itr = archiveClasspathUrls.iterator(); 294 while ( itr.hasNext() ) 295 { 296 final File archive = ( File ) itr.next(); 297 log.debug( "Passing archive [" + archive + "] to Hibernate Configration" ); 298 cfg.addJar( archive ); 299 } 300 301 itr = directoryClasspathUrls.iterator(); 302 while ( itr.hasNext() ) 303 { 304 final File directory = ( File ) itr.next(); 305 log.debug( "Passing directory [" + directory + "] to Hibernate Configration" ); 306 cfg.addDirectory( directory ); 307 } 308 } 309 310 315 private void scanForMappings() throws DeploymentException 316 { 317 URL [] urls = null; 321 ClassLoader cl = Thread.currentThread().getContextClassLoader(); 322 if ( cl instanceof RepositoryClassLoader ) 323 { 324 urls = ( ( RepositoryClassLoader ) cl ).getClasspath(); 325 } 326 else if ( cl instanceof URLClassLoader ) 327 { 328 urls = ( ( URLClassLoader ) cl ).getURLs(); 329 } 330 else 331 { 332 throw new DeploymentException( "Unable to determine urls from classloader [" + cl + "]" ); 333 } 334 335 for ( int i = 0; i < urls.length; i++ ) 338 { 339 final File entry = new File ( urls[i].getFile() ); 340 log.trace( "checking classpath entry [" + entry + "]" ); 341 if ( !entry.exists() ) 342 { 343 continue; 344 } 345 346 if ( !entry.isDirectory() ) 347 { 348 if ( isArchive( entry ) ) 351 { 352 log.trace( "classpath entry was an archive file..." ); 353 archiveClasspathUrls.add( entry ); 354 } 355 else 356 { 357 log.trace( "classpath entry was a non-archive file..." ); 358 } 359 } 360 else 361 { 362 log.trace( "classpath entry was a directory..." ); 363 364 directoryClasspathUrls.add( entry ); 366 } 367 } 368 } 369 370 377 private boolean isArchive(File file) 378 { 379 try 380 { 381 new JarFile ( file ); 382 return true; 383 } 384 catch ( Throwable t ) 385 { 386 return false; 387 } 388 } 389 390 396 private void transferSettings(Properties settings) 397 { 398 if ( cacheProviderClass == null ) 399 { 400 cacheProviderClass = "org.hibernate.cache.HashtableCacheProvider"; 401 } 402 403 log.debug( "Using JDBC batch size : " + jdbcBatchSize ); 404 405 setUnlessNull( settings, Environment.DATASOURCE, datasourceName ); 406 setUnlessNull( settings, Environment.DIALECT, dialect ); 407 setUnlessNull( settings, Environment.CACHE_PROVIDER, cacheProviderClass ); 408 setUnlessNull( settings, Environment.CACHE_REGION_PREFIX, cacheRegionPrefix ); 409 setUnlessNull( settings, Environment.USE_MINIMAL_PUTS, minimalPutsEnabled ); 410 setUnlessNull( settings, Environment.HBM2DDL_AUTO, hbm2ddlAuto ); 411 setUnlessNull( settings, Environment.DEFAULT_SCHEMA, defaultSchema ); 412 setUnlessNull( settings, Environment.STATEMENT_BATCH_SIZE, jdbcBatchSize ); 413 setUnlessNull( settings, Environment.USE_SQL_COMMENTS, sqlCommentsEnabled ); 414 415 setUnlessNull( settings, Environment.STATEMENT_FETCH_SIZE, jdbcFetchSize ); 416 setUnlessNull( settings, Environment.USE_SCROLLABLE_RESULTSET, jdbcScrollableResultSetEnabled ); 417 setUnlessNull( settings, Environment.USE_QUERY_CACHE, queryCacheEnabled ); 418 setUnlessNull( settings, Environment.USE_STRUCTURED_CACHE, structuredCacheEntriesEnabled ); 419 setUnlessNull( settings, Environment.QUERY_SUBSTITUTIONS, querySubstitutions ); 420 setUnlessNull( settings, Environment.MAX_FETCH_DEPTH, maxFetchDepth ); 421 setUnlessNull( settings, Environment.SHOW_SQL, showSqlEnabled ); 422 setUnlessNull( settings, Environment.USE_GET_GENERATED_KEYS, getGeneratedKeysEnabled ); 423 setUnlessNull( settings, Environment.USER, username ); 424 setUnlessNull( settings, Environment.PASS, password ); 425 setUnlessNull( settings, Environment.BATCH_VERSIONED_DATA, batchVersionedDataEnabled ); 426 setUnlessNull( settings, Environment.USE_STREAMS_FOR_BINARY, streamsForBinaryEnabled ); 427 setUnlessNull( settings, Environment.USE_REFLECTION_OPTIMIZER, reflectionOptimizationEnabled ); 428 setUnlessNull( settings, Environment.GENERATE_STATISTICS, statGenerationEnabled ); 429 430 setUnlessNull( 431 settings, Environment.TRANSACTION_MANAGER_STRATEGY, JBossTransactionManagerLookup.class.getName() 432 ); 433 setUnlessNull( settings, Environment.TRANSACTION_STRATEGY, JTATransactionFactory.class.getName() ); 434 435 if ( deployedTreeCacheObjectName != null ) 436 { 437 String objNameString = deployedTreeCacheObjectName.toString(); 438 if ( objNameString != null && !"".equals( objNameString ) ) 439 { 440 settings.setProperty( DeployedTreeCacheProvider.OBJECT_NAME_PROP, objNameString ); 441 } 442 } 443 444 settings.setProperty( Environment.FLUSH_BEFORE_COMPLETION, "true" ); 445 settings.setProperty( Environment.AUTO_CLOSE_SESSION, "true" ); 446 447 settings.setProperty( "hibernate.connection.agressive_release", "true" ); 454 settings.setProperty( "hibernate.connection.release_mode", "after_statement" ); 455 } 456 457 465 private void setUnlessNull(Properties props, String key, Object value) 466 { 467 if ( value != null ) 468 { 469 props.setProperty( key, value.toString() ); 470 } 471 } 472 473 private ListenerInjector generateListenerInjectorInstance() 474 { 475 if ( listenerInjector == null ) 476 { 477 return null; 478 } 479 480 log.info( "attempting to use listener injector [" + listenerInjector + "]" ); 481 try 482 { 483 return ( ListenerInjector ) Thread.currentThread() 484 .getContextClassLoader() 485 .loadClass( listenerInjector ) 486 .newInstance(); 487 } 488 catch ( Throwable t ) 489 { 490 log.warn( "Unable to generate specified listener injector", t ); 491 } 492 493 return null; 494 } 495 496 private Interceptor generateInterceptorInstance() 497 { 498 if ( sessionFactoryInterceptor == null ) 499 { 500 return null; 501 } 502 503 log.info( "Generating session factory interceptor instance [" + sessionFactoryInterceptor + "]" ); 504 try 505 { 506 return ( Interceptor ) Thread.currentThread() 507 .getContextClassLoader() 508 .loadClass( sessionFactoryInterceptor ) 509 .newInstance(); 510 } 511 catch ( Throwable t ) 512 { 513 log.warn( "Unable to generate session factory interceptor instance", t ); 514 } 515 516 return null; 517 } 518 519 524 private void bind() throws HibernateException 525 { 526 InitialContext ctx = null; 527 try 528 { 529 ctx = new InitialContext (); 530 Util.bind( ctx, sessionFactoryName, sessionFactory ); 531 } 532 catch ( NamingException e ) 533 { 534 throw new HibernateException( "Unable to bind SessionFactory into JNDI", e ); 535 } 536 finally 537 { 538 if ( ctx != null ) 539 { 540 try 541 { 542 ctx.close(); 543 } 544 catch ( Throwable ignore ) 545 { 546 } 548 } 549 } 550 } 551 552 557 private void unbind() throws HibernateException 558 { 559 InitialContext ctx = null; 560 try 561 { 562 ctx = new InitialContext (); 563 Util.unbind( ctx, sessionFactoryName ); 564 } 565 catch ( NamingException e ) 566 { 567 throw new HibernateException( "Unable to unbind SessionFactory from JNDI", e ); 568 } 569 finally 570 { 571 if ( ctx != null ) 572 { 573 try 574 { 575 ctx.close(); 576 } 577 catch ( Throwable ignore ) 578 { 579 } 581 } 582 } 583 } 584 585 private void forceCleanup() 586 { 587 try 588 { 589 sessionFactory.close(); 590 sessionFactory = null; 591 } 592 catch ( Throwable ignore ) 593 { 594 } 596 } 597 598 public String toString() 599 { 600 return super.toString() + " [ServiceName=" + serviceName + ", JNDI=" + sessionFactoryName + "]"; 601 } 602 603 604 606 public void rebuildSessionFactory() throws Exception 607 { 608 destroySessionFactory(); 609 buildSessionFactory(); 610 } 611 612 613 615 public boolean isDirty() 616 { 617 return dirty; 618 } 619 620 public boolean isSessionFactoryRunning() 621 { 622 return sessionFactory != null; 623 } 624 625 public String getVersion() 626 { 627 return Environment.VERSION; 628 } 629 630 public SessionFactory getInstance() 631 { 632 return sessionFactory; 633 } 634 635 public ObjectName getStatisticsServiceName() 636 { 637 return hibernateStatisticsServiceName; 638 } 639 640 public Date getRunningSince() 641 { 642 return runningSince; 643 } 644 645 647 public String getSessionFactoryName() 648 { 649 return sessionFactoryName; 650 } 651 652 public void setSessionFactoryName(String sessionFactoryName) 653 { 654 this.sessionFactoryName = sessionFactoryName; 655 dirty = true; 656 } 657 658 public String getDatasourceName() 659 { 660 return datasourceName; 661 } 662 663 public void setDatasourceName(String datasourceName) 664 { 665 this.datasourceName = datasourceName; 666 dirty = true; 667 } 668 669 public String getUsername() 670 { 671 return username; 672 } 673 674 public void setUsername(String username) 675 { 676 this.username = username; 677 dirty = true; 678 } 679 680 public void setPassword(String password) 681 { 682 this.password = password; 683 dirty = true; 684 } 685 686 public String getDefaultSchema() 687 { 688 return defaultSchema; 689 } 690 691 public void setDefaultSchema(String defaultSchema) 692 { 693 this.defaultSchema = defaultSchema; 694 dirty = true; 695 } 696 697 public String getDefaultCatalog() 698 { 699 return defaultCatalog; 700 } 701 702 public void setDefaultCatalog(String defaultCatalog) 703 { 704 this.defaultCatalog = defaultCatalog; 705 } 706 707 public String getHbm2ddlAuto() 708 { 709 return hbm2ddlAuto; 710 } 711 712 public void setHbm2ddlAuto(String hbm2ddlAuto) 713 { 714 this.hbm2ddlAuto = hbm2ddlAuto; 715 dirty = true; 716 } 717 718 public String getDialect() 719 { 720 return dialect; 721 } 722 723 public void setDialect(String dialect) 724 { 725 this.dialect = dialect; 726 dirty = true; 727 } 728 729 public Integer getMaxFetchDepth() 730 { 731 return maxFetchDepth; 732 } 733 734 public void setMaxFetchDepth(Integer maxFetchDepth) 735 { 736 this.maxFetchDepth = maxFetchDepth; 737 dirty = true; 738 } 739 740 public Integer getJdbcBatchSize() 741 { 742 return jdbcBatchSize; 743 } 744 745 public void setJdbcBatchSize(Integer jdbcBatchSize) 746 { 747 this.jdbcBatchSize = jdbcBatchSize; 748 dirty = true; 749 } 750 751 public Integer getJdbcFetchSize() 752 { 753 return jdbcFetchSize; 754 } 755 756 public void setJdbcFetchSize(Integer jdbcFetchSize) 757 { 758 this.jdbcFetchSize = jdbcFetchSize; 759 dirty = true; 760 } 761 762 public Boolean getJdbcScrollableResultSetEnabled() 763 { 764 return jdbcScrollableResultSetEnabled; 765 } 766 767 public void setJdbcScrollableResultSetEnabled(Boolean jdbcScrollableResultSetEnabled) 768 { 769 this.jdbcScrollableResultSetEnabled = jdbcScrollableResultSetEnabled; 770 dirty = true; 771 } 772 773 public Boolean getGetGeneratedKeysEnabled() 774 { 775 return getGeneratedKeysEnabled; 776 } 777 778 public void setGetGeneratedKeysEnabled(Boolean getGeneratedKeysEnabled) 779 { 780 this.getGeneratedKeysEnabled = getGeneratedKeysEnabled; 781 dirty = true; 782 } 783 784 public String getQuerySubstitutions() 785 { 786 return querySubstitutions; 787 } 788 789 public void setQuerySubstitutions(String querySubstitutions) 790 { 791 this.querySubstitutions = querySubstitutions; 792 dirty = true; 793 } 794 795 public Boolean getSecondLevelCacheEnabled() 796 { 797 return secondLevelCacheEnabled; 798 } 799 800 public void setSecondLevelCacheEnabled(Boolean secondLevelCacheEnabled) 801 { 802 this.secondLevelCacheEnabled = secondLevelCacheEnabled; 803 dirty = true; 804 } 805 806 public Boolean getQueryCacheEnabled() 807 { 808 return queryCacheEnabled; 809 } 810 811 public void setQueryCacheEnabled(Boolean queryCacheEnabled) 812 { 813 this.queryCacheEnabled = queryCacheEnabled; 814 dirty = true; 815 } 816 817 public String getCacheProviderClass() 818 { 819 return cacheProviderClass; 820 } 821 822 public void setCacheProviderClass(String cacheProviderClass) 823 { 824 this.cacheProviderClass = cacheProviderClass; 825 dirty = true; 826 } 827 828 public String getCacheRegionPrefix() 829 { 830 return cacheRegionPrefix; 831 } 832 833 public void setCacheRegionPrefix(String cacheRegionPrefix) 834 { 835 this.cacheRegionPrefix = cacheRegionPrefix; 836 dirty = true; 837 } 838 839 public Boolean getMinimalPutsEnabled() 840 { 841 return minimalPutsEnabled; 842 } 843 844 public void setMinimalPutsEnabled(Boolean minimalPutsEnabled) 845 { 846 this.minimalPutsEnabled = minimalPutsEnabled; 847 dirty = true; 848 } 849 850 public Boolean getUseStructuredCacheEntriesEnabled() 851 { 852 return structuredCacheEntriesEnabled; 853 } 854 855 public void setUseStructuredCacheEntriesEnabled(Boolean structuredCacheEntriesEnabled) 856 { 857 this.structuredCacheEntriesEnabled = structuredCacheEntriesEnabled; 858 } 859 860 public Boolean getShowSqlEnabled() 861 { 862 return showSqlEnabled; 863 } 864 865 public void setShowSqlEnabled(Boolean showSqlEnabled) 866 { 867 this.showSqlEnabled = showSqlEnabled; 868 dirty = true; 869 } 870 871 public Boolean getSqlCommentsEnabled() 872 { 873 return sqlCommentsEnabled; 874 } 875 876 public void setSqlCommentsEnabled(Boolean commentsEnabled) 877 { 878 this.sqlCommentsEnabled = commentsEnabled; 879 } 880 881 public String getSessionFactoryInterceptor() 882 { 883 return sessionFactoryInterceptor; 884 } 885 886 public void setSessionFactoryInterceptor(String sessionFactoryInterceptor) 887 { 888 this.sessionFactoryInterceptor = sessionFactoryInterceptor; 889 dirty = true; 890 } 891 892 public String getListenerInjector() 893 { 894 return listenerInjector; 895 } 896 897 public void setListenerInjector(String listenerInjector) 898 { 899 this.listenerInjector = listenerInjector; 900 } 901 902 public ObjectName getDeployedTreeCacheObjectName() 903 { 904 return deployedTreeCacheObjectName; 905 } 906 907 public void setDeployedTreeCacheObjectName(ObjectName deployedTreeCacheObjectName) 908 { 909 this.deployedTreeCacheObjectName = deployedTreeCacheObjectName; 910 } 911 912 public Boolean getBatchVersionedDataEnabled() 913 { 914 return batchVersionedDataEnabled; 915 } 916 917 public void setBatchVersionedDataEnabled(Boolean batchVersionedDataEnabled) 918 { 919 this.batchVersionedDataEnabled = batchVersionedDataEnabled; 920 this.dirty = true; 921 } 922 923 public Boolean getStreamsForBinaryEnabled() 924 { 925 return streamsForBinaryEnabled; 926 } 927 928 public void setStreamsForBinaryEnabled(Boolean streamsForBinaryEnabled) 929 { 930 this.streamsForBinaryEnabled = streamsForBinaryEnabled; 931 this.dirty = true; 932 } 933 934 public Boolean getReflectionOptimizationEnabled() 935 { 936 return reflectionOptimizationEnabled; 937 } 938 939 public void setReflectionOptimizationEnabled(Boolean reflectionOptimizationEnabled) 940 { 941 this.reflectionOptimizationEnabled = reflectionOptimizationEnabled; 942 this.dirty = true; 943 } 944 945 public Boolean getStatGenerationEnabled() 946 { 947 return statGenerationEnabled; 948 } 949 950 public void setStatGenerationEnabled(Boolean statGenerationEnabled) 951 { 952 this.statGenerationEnabled = statGenerationEnabled; 953 } 954 955 public URL getHarUrl() 956 { 957 return harUrl; 958 } 959 960 public void setHarUrl(URL harUrl) 961 { 962 this.harUrl = harUrl; 963 dirty = true; 964 } 965 966 public boolean isScanForMappingsEnabled() 967 { 968 return scanForMappingsEnabled; 969 } 970 971 public void setScanForMappingsEnabled(boolean scanForMappingsEnabled) 972 { 973 this.scanForMappingsEnabled = scanForMappingsEnabled; 974 } 975 976 981 public DeploymentInfo getDeploymentInfo() 982 { 983 try 984 { 985 return super.getDeploymentInfo(); 986 } 987 catch ( Throwable t ) 988 { 989 return null; 990 } 991 } 992 } 993 | Popular Tags |