当前位置: 首页>>代码示例>>Java>>正文


Java PropertyCheck类代码示例

本文整理汇总了Java中org.alfresco.util.PropertyCheck的典型用法代码示例。如果您正苦于以下问题:Java PropertyCheck类的具体用法?Java PropertyCheck怎么用?Java PropertyCheck使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PropertyCheck类属于org.alfresco.util包,在下文中一共展示了PropertyCheck类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onBootstrap

import org.alfresco.util.PropertyCheck; //导入依赖的package包/类
@Override
protected void onBootstrap(ApplicationEvent event)
{
    PropertyCheck.mandatory(this, "moduleService", moduleService);
    final RetryingTransactionCallback<Object> startModulesCallback = new RetryingTransactionCallback<Object>()
    {
        public Object execute() throws Throwable
        {
            moduleService.startModules();
            return null;
        }
    };
    
    AuthenticationUtil.runAs(new RunAsWork<Object>()
    {
        @Override
        public Object doWork() throws Exception 
        {
            transactionService.getRetryingTransactionHelper().doInTransaction(startModulesCallback, transactionService.isReadOnly());
            return null;
        }
    	
    }, AuthenticationUtil.getSystemUserName());       
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:ModuleStarter.java

示例2: init

import org.alfresco.util.PropertyCheck; //导入依赖的package包/类
/**
 * Check that all properties are properly set
 */
public void init() throws SchedulerException
{
    PropertyCheck.mandatory(this, "scheduler", scheduler);
    PropertyCheck.mandatory(this, "transactionService", transactionService);
    PropertyCheck.mandatory(this, "repoUsageComponent", repoUsageComponent);
    PropertyCheck.mandatory(this, "jobLockService", jobLockService);

    // Trigger the scheduled updates
    final JobDetail jobDetail = new JobDetail("rmj", Scheduler.DEFAULT_GROUP, RepoUsageMonitorJob.class);
    jobDetail.getJobDataMap().put("RepoUsageMonitor", this);
    final Trigger trigger = TriggerUtils.makeHourlyTrigger(12);                         // every 12 hours
    trigger.setStartTime(new Date(System.currentTimeMillis() + 60L * 60L * 1000L));     // one hour from now
    trigger.setName("rmt");
    trigger.setGroup(Scheduler.DEFAULT_GROUP);
    
    repoUsageComponent.observeRestrictions(this);
    
    // Unschedule in case it was scheduled in an earlier retry of the transaction
    scheduler.unscheduleJob("rmt", Scheduler.DEFAULT_GROUP);
    scheduler.scheduleJob(jobDetail, trigger);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:RepoUsageMonitor.java

示例3: init

import org.alfresco.util.PropertyCheck; //导入依赖的package包/类
public void init()
{
    if (!PropertyCheck.isValidPropertyString(getLocation()))
    {
        setLocation(null);
    }
    if (!PropertyCheck.isValidPropertyString(getProvider()))
    {
        setProvider(null);
    }
    if (!PropertyCheck.isValidPropertyString(getType()))
    {
        setType(null);
    }
    if (!PropertyCheck.isValidPropertyString(getKeyMetaDataFileLocation()))
    {
        setKeyMetaDataFileLocation(null);
    }        
}
 
开发者ID:Alfresco,项目名称:alfresco-core,代码行数:20,代码来源:KeyStoreParameters.java

示例4: checkProperties

import org.alfresco.util.PropertyCheck; //导入依赖的package包/类
/**
 * Perform basic checks to ensure that the necessary dependencies were injected.
 */
private void checkProperties()
{
    PropertyCheck.mandatory(this, "jobLockService", jobLockService);
    PropertyCheck.mandatory(this, "contentDataDAO", contentDataDAO);
    PropertyCheck.mandatory(this, "dictionaryService", dictionaryService);
    PropertyCheck.mandatory(this, "contentService", contentService);
    PropertyCheck.mandatory(this, "transactionService", transactionService);
    PropertyCheck.mandatory(this, "eagerContentStoreCleaner", eagerContentStoreCleaner);
    
    // check the protect days
    if (protectDays < 0)
    {
        throw new AlfrescoRuntimeException("Property 'protectDays' must be 0 or greater (0 is not recommended)");
    }
    else if (protectDays == 0)
    {
        logger.warn(
                "Property 'protectDays' is set to 0.  " +
                "Please ensure that your backup strategy is appropriate for this setting.");
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:ContentStoreCleaner.java

示例5: init

import org.alfresco.util.PropertyCheck; //导入依赖的package包/类
public void init()
{
    PropertyCheck.mandatory(this, "diskInterface", diskInterface);
    PropertyCheck.mandatory(this, "diskSizeInterface", diskSizeInterface);
    PropertyCheck.mandatory(this, "ioctltInterface", ioctlInterface);
    PropertyCheck.mandatory(this, "fileInfoCache", fileInfoCache);
    PropertyCheck.mandatory(this, "fileLockingInterface", getFileLockingInterface());
    PropertyCheck.mandatory(this, "opLockInterface", getOpLockInterface());
    PropertyCheck.mandatory(this, "fileLockingInterface", fileLockingInterface);
    PropertyCheck.mandatory(this, "policyComponent", getPolicyComponent());
    
    getPolicyComponent().bindClassBehaviour( NodeServicePolicies.OnDeleteNodePolicy.QNAME,
            this, new JavaBehaviour(this, "onDeleteNode"));   
    getPolicyComponent().bindClassBehaviour( NodeServicePolicies.OnMoveNodePolicy.QNAME,
            this, new JavaBehaviour(this, "onMoveNode"));
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:17,代码来源:BufferedContentDiskDriver.java

示例6: init

import org.alfresco.util.PropertyCheck; //导入依赖的package包/类
/**
 * 
 */
public void init()
{
    PropertyCheck.mandatory(this, "checkOutCheckInService", checkOutCheckInService);
    PropertyCheck.mandatory(this, "cifsHelper", cifsHelper);
    PropertyCheck.mandatory(this, "namespaceService", namespaceService);
    PropertyCheck.mandatory(this, "nodeService", nodeService);
    PropertyCheck.mandatory(this, "searchService", searchService);
    PropertyCheck.mandatory(this, "contentService", contentService);
    PropertyCheck.mandatory(this, "mimetypeService", mimetypeService);
    PropertyCheck.mandatory(this, "permissionService", permissionService);
    PropertyCheck.mandatory(this, "fileFolderService", fileFolderService);
    PropertyCheck.mandatory(this, "lockService",lockService);
    PropertyCheck.mandatory(this, "authContext", authContext);
    PropertyCheck.mandatory(this, "authService", authService);
    PropertyCheck.mandatory(this, "policyBehaviourFilter", policyBehaviourFilter);
    PropertyCheck.mandatory(this, "m_nodeMonitorFactory", m_nodeMonitorFactory);
    PropertyCheck.mandatory(this, "ioControlHandler", ioControlHandler);
    PropertyCheck.mandatory(this, "contentComparator", getContentComparator());
    PropertyCheck.mandatory(this, "nodeArchiveService", nodeArchiveService);
    PropertyCheck.mandatory(this, "hiddenAspect", hiddenAspect);
    PropertyCheck.mandatory(this, "lockKeeper", lockKeeper);
    PropertyCheck.mandatory(this, "deletePseudoFileCache",  deletePseudoFileCache);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:27,代码来源:ContentDiskDriver2.java

示例7: setFolderPath

import org.alfresco.util.PropertyCheck; //导入依赖的package包/类
/**
 * Set the folder name path <b>relative to the {@link #getFolderPath() path}</b>.
 * 
 * @param folderPath            a folder-name path using the '<b>/</b>' path separator e.g. '<b>IMAP HOME/MAIL-1</b>'
 */
public void setFolderPath(String folderPath)
{
    if (!PropertyCheck.isValidPropertyString(folderPath))
    {
        throw new IllegalArgumentException("Invalid folder name path for property 'folderPath': " + folderPath);
    }
    StringTokenizer tokenizer = new StringTokenizer(folderPath, "/");
    StringBuilder pathBuff = new StringBuilder(folderPath.length());
    while (tokenizer.hasMoreTokens())
    {
        String folderName = tokenizer.nextToken();
        if (folderName.length() == 0)
        {
            throw new IllegalArgumentException("Invalid folder name path for property 'folderPath': " + folderPath);
        }
        pathBuff.append(folderName);
        if (tokenizer.hasMoreTokens())
        {
            pathBuff.append('/');
        }
    }
    this.folderPath = pathBuff.toString();
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:29,代码来源:RepositoryFolderConfigBean.java

示例8: init

import org.alfresco.util.PropertyCheck; //导入依赖的package包/类
/**
 * Checks that all necessary properties and services have been provided.
 */
public void init()
{
    PropertyCheck.mandatory(this, "nodeService", nodeService);
    PropertyCheck.mandatory(this, "WorkflowService", workflowService);
    PropertyCheck.mandatory(this, "ActionService", actionService);
    PropertyCheck.mandatory(this, "PersonService", personService);
    PropertyCheck.mandatory(this, "SiteService", siteService);
    PropertyCheck.mandatory(this, "AuthenticationService", authenticationService);
    PropertyCheck.mandatory(this, "PermissionService", permissionService);
    PropertyCheck.mandatory(this, "NamespaceService", namespaceService);
    PropertyCheck.mandatory(this, "NodeService", nodeService);
    PropertyCheck.mandatory(this, "UserNameGenerator", usernameGenerator);
    PropertyCheck.mandatory(this, "PasswordGenerator", passwordGenerator);
    PropertyCheck.mandatory(this, "PolicyComponent", policyComponent);
    PropertyCheck.mandatory(this, "templateService", templateService);
    
    this.inviteNominatedSender = new InviteNominatedSender(serviceRegistry, repositoryHelper, messageService);
    this.inviteModeratedSender = new InviteModeratedSender(serviceRegistry, repositoryHelper, messageService);
    
    //
    this.policyComponent.bindClassBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI, "beforeDeleteNode"),
                SiteModel.TYPE_SITE, new JavaBehaviour(this, "beforeDeleteNode"));
    this.policyComponent.bindClassBehaviour(BeforeDeleteNodePolicy.QNAME, ContentModel.TYPE_PERSON, new JavaBehaviour(this, "beforeDeleteNode"));
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:28,代码来源:InvitationServiceImpl.java

示例9: init

import org.alfresco.util.PropertyCheck; //导入依赖的package包/类
@Override
protected void init()
{
    PropertyCheck.mandatory(this, "xpathMappingProperties", xpathExpressionMapping);
    // Get the base class to set up its mappings
    super.init();
    // Remove all XPath expressions that aren't going to be used
    Map<String, Set<QName>> mapping = getMapping();
    Set<String> xpathExpressionMappingKeys = new HashSet<String>(xpathExpressionMapping.keySet());
    for (String xpathMappingKey : xpathExpressionMappingKeys)
    {
        if (!mapping.containsKey(xpathMappingKey))
        {
            xpathExpressionMapping.remove(xpathMappingKey);
        }
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:XPathMetadataExtracter.java

示例10: init

import org.alfresco.util.PropertyCheck; //导入依赖的package包/类
/**
 * Checks that all necessary properties and services have been provided.
 */
public void init()
{
    PropertyCheck.mandatory(this, "nodeService", nodeService);
    PropertyCheck.mandatory(this, "directNodeService", directNodeService);
    PropertyCheck.mandatory(this, "fileFolderService", fileFolderService);
    PropertyCheck.mandatory(this, "searchService", searchService);
    PropertyCheck.mandatory(this, "namespaceService", namespaceService);
    PropertyCheck.mandatory(this, "permissionService", permissionService);
    PropertyCheck.mandatory(this, "authenticationContext", authenticationContext);
    PropertyCheck.mandatory(this, "personService", personService);
    PropertyCheck.mandatory(this, "activityService", activityService);
    PropertyCheck.mandatory(this, "taggingService", taggingService);
    PropertyCheck.mandatory(this, "authorityService", authorityService);
    PropertyCheck.mandatory(this, "sitesXPath", sitesXPath);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:19,代码来源:SiteServiceImpl.java

示例11: register

import org.alfresco.util.PropertyCheck; //导入依赖的package包/类
/**
 * Register the deployment target with the deployment target registry
 */
public void register()
{
	PropertyCheck.mandatory(this, "typeQName", typeQName);
	PropertyCheck.mandatory(this, "versionService", getVersionService());
	PropertyCheck.mandatory(this, "policy", policy);
    PropertyCheck.mandatory(this, "prefixResolver", prefixResolver);
	
	/**
	 * Go ahead and register the version label policy with the 
	 * versionService
	 */
	QName qName = QName.createQName(typeQName, prefixResolver);
	getVersionService().registerVersionLabelPolicy(qName, policy);
    
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:19,代码来源:VersionServiceVersionLabelRegistrationBean.java

示例12: checkProperties

import org.alfresco.util.PropertyCheck; //导入依赖的package包/类
/**
 * Perform basic checks to ensure that the necessary dependencies were injected.
 */
private void checkProperties()
{
    PropertyCheck.mandatory(this, "postDAO", postDAO);
    PropertyCheck.mandatory(this, "nodeService", nodeService);
    PropertyCheck.mandatory(this, "permissionService", permissionService);
    PropertyCheck.mandatory(this, "transactionService", transactionService);
    PropertyCheck.mandatory(this, "personService", personService);
    PropertyCheck.mandatory(this, "tenantService", tenantService);
    
    rollupTypes.put(ActivityType.FILE_ADDED,   ActivityType.FILES_ADDED);
    rollupTypes.put(ActivityType.FILE_UPDATED, ActivityType.FILES_UPDATED);
    rollupTypes.put(ActivityType.FILE_DELETED, ActivityType.FILES_DELETED);
    
    rollupTypes.put(ActivityType.FOLDER_ADDED,   ActivityType.FOLDERS_ADDED);
    rollupTypes.put(ActivityType.FOLDER_DELETED, ActivityType.FOLDERS_DELETED);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:PostLookup.java

示例13: safeInit

import org.alfresco.util.PropertyCheck; //导入依赖的package包/类
/**
 * Initializes class
 */
private void safeInit()
{
    PropertyCheck.mandatory(this, "location", getKeyStoreParameters().getLocation());

    // Make sure we choose the default type, if required
    if(getKeyStoreParameters().getType() == null)
    {
        keyStoreParameters.setType(KeyStore.getDefaultType());
    }

    writeLock.lock();
    try
    {
        keys = loadKeyStore(keyStoreParameters);
        backupKeys = loadKeyStore(backupKeyStoreParameters);
    }
    finally
    {
        writeLock.unlock();
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-core,代码行数:25,代码来源:AlfrescoKeyStoreImpl.java

示例14: getLinkDestination

import org.alfresco.util.PropertyCheck; //导入依赖的package包/类
@Override
public NodeRef getLinkDestination(NodeRef linkNodeRef)
{
    /* Validate input */
    PropertyCheck.mandatory(this, "linkNodeRef", linkNodeRef);

    /* Check if the node exists */
    if (!nodeService.exists(linkNodeRef))
    {
        throw new IllegalArgumentException("The provided node does not exist");
    }

    if (!nodeService.getType(linkNodeRef).equals(ApplicationModel.TYPE_FILELINK)
            && !nodeService.getType(linkNodeRef).equals(ApplicationModel.TYPE_FOLDERLINK))
    {
        throw new IllegalArgumentException("The provided node is not a document link");
    }

    return (NodeRef) nodeService.getProperty(linkNodeRef, ContentModel.PROP_LINK_DESTINATION);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:21,代码来源:DocumentLinkServiceImpl.java

示例15: init

import org.alfresco.util.PropertyCheck; //导入依赖的package包/类
/**
 * Lifecycle method. Should be called immediately after constructing objects of this type (e.g. by the
 * Spring framework's application context).
 */
public void init()
{        
    if (log.isDebugEnabled())
    {
        log.debug("Starting quota strategy.");
    }
    PropertyCheck.mandatory(this, "cleaner", cleaner);
    PropertyCheck.mandatory(this, "cache", cache);
    
    if (maxUsageBytes < (10 * FileUtils.ONE_MB))
    {
        if (log.isWarnEnabled())
        {
            log.warn("Low maxUsageBytes of " + maxUsageBytes + "bytes - did you mean to specify in MB?");
        }
    }
    
    loadDiskUsage();
    // Set the time to start the normal clean
    lastCleanupStart.set(System.currentTimeMillis() - normalCleanThresholdSec);
    // Run the cleaner thread so that it can update the disk usage more accurately.
    signalCleanerStart("quota (init)");
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:28,代码来源:StandardQuotaStrategy.java


注:本文中的org.alfresco.util.PropertyCheck类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。