下面列出了java.util.EmptyStackException#org.osgi.framework.InvalidSyntaxException 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
public WebMetadataService getWebMetadataService() {
if (webMetadataService == null) {
// Get all Services implement WebMetadataService interface
try {
ServiceReference<?>[] references = this.context
.getAllServiceReferences(
WebMetadataService.class.getName(), null);
for (ServiceReference<?> ref : references) {
return (WebMetadataService) this.context.getService(ref);
}
return null;
}
catch (InvalidSyntaxException e) {
LOGGER.warning("Cannot load WebMetadataService on JQueryOperationsImpl.");
return null;
}
}
else {
return webMetadataService;
}
}
public MetadataDependencyRegistry getMetadataDependencyRegistry() {
if (metadataDependencyRegistry == null) {
// Get all Services implement MetadataDependencyRegistry interface
try {
ServiceReference<?>[] references = this.context
.getAllServiceReferences(
MetadataDependencyRegistry.class.getName(),
null);
for (ServiceReference<?> ref : references) {
return (MetadataDependencyRegistry) this.context
.getService(ref);
}
return null;
}
catch (InvalidSyntaxException e) {
LOGGER.warning("Cannot load MetadataDependencyRegistry on DatatablesJspMetadataListener.");
return null;
}
}
else {
return metadataDependencyRegistry;
}
}
public TypeManagementService getTypeManagementService() {
if (typeManagementService == null) {
// Get all Services implement TypeManagementService interface
try {
ServiceReference<?>[] references = this.context
.getAllServiceReferences(
TypeManagementService.class.getName(), null);
for (ServiceReference<?> ref : references) {
return (TypeManagementService) this.context.getService(ref);
}
return null;
}
catch (InvalidSyntaxException e) {
LOGGER.warning("Cannot load TypeManagementService on MonitoringOperationsImpl.");
return null;
}
}
else {
return typeManagementService;
}
}
public OperationUtils getOperationUtils() {
if (operationUtils == null) {
// Get all Services implement OperationUtils interface
try {
ServiceReference<?>[] references = context
.getAllServiceReferences(
OperationUtils.class.getName(), null);
for (ServiceReference<?> ref : references) {
operationUtils = (OperationUtils) context.getService(ref);
return operationUtils;
}
return null;
}
catch (InvalidSyntaxException e) {
LOGGER.warning("Cannot load OperationUtils on WebProjectUtilsImpl.");
return null;
}
}
else {
return operationUtils;
}
}
public ProjectOperations getProjectOperations() {
if (projectOperations == null) {
// Get all Services implement ProjectOperations interface
try {
ServiceReference<?>[] references = this.context
.getAllServiceReferences(
ProjectOperations.class.getName(), null);
for (ServiceReference<?> ref : references) {
return (ProjectOperations) this.context.getService(ref);
}
return null;
}
catch (InvalidSyntaxException e) {
logger.warning("Cannot load ProjectOperations on ReportMetadataProvider.");
return null;
}
}
else {
return projectOperations;
}
}
public WebProjectUtils getWebProjectUtils() {
if (webProjectUtils == null) {
// Get all Services implement WebProjectUtils interface
try {
ServiceReference<?>[] references = context
.getAllServiceReferences(
WebProjectUtils.class.getName(), null);
for (ServiceReference<?> ref : references) {
webProjectUtils = (WebProjectUtils) context.getService(ref);
return webProjectUtils;
}
return null;
}
catch (InvalidSyntaxException e) {
LOGGER.warning("Cannot load WebProjectUtils on MessageBundleUtilsImpl.");
return null;
}
}
else {
return webProjectUtils;
}
}
public MetadataService getMetadataService() {
if (metadataService == null) {
// Get all Services implement MetadataService interface
try {
ServiceReference<?>[] references = this.context
.getAllServiceReferences(
MetadataService.class.getName(), null);
for (ServiceReference<?> ref : references) {
return (MetadataService) this.context.getService(ref);
}
return null;
}
catch (InvalidSyntaxException e) {
LOGGER.warning("Cannot load MetadataService on BootstrapOperationsImpl.");
return null;
}
}
else {
return metadataService;
}
}
public ProjectOperations getProjectOperations() {
if (projectOperations == null) {
// Get all Services implement ProjectOperations interface
try {
ServiceReference<?>[] references = this.context
.getAllServiceReferences(
ProjectOperations.class.getName(), null);
for (ServiceReference<?> ref : references) {
return (ProjectOperations) this.context.getService(ref);
}
return null;
}
catch (InvalidSyntaxException e) {
LOGGER.warning("Cannot load ProjectOperations on MonitoringOperationsImpl.");
return null;
}
}
else {
return projectOperations;
}
}
private Filter toFilter(List<String> procs, List<String> oses, List<VersionRange> vers, List<String> langs, String sf)
throws InvalidSyntaxException
{
final StringBuffer sb = new StringBuffer(80);
int elems = 0;
elems = andAdd(sb, orString(NativeNamespace.CAPABILITY_PROCESSOR_ATTRIBUTE, procs));
elems += andAdd(sb, orString(NativeNamespace.CAPABILITY_OSNAME_ATTRIBUTE, oses));
elems += andAdd(sb, orString(NativeNamespace.CAPABILITY_OSVERSION_ATTRIBUTE, vers));
elems += andAdd(sb, orString(NativeNamespace.CAPABILITY_LANGUAGE_ATTRIBUTE, langs));
elems += andAdd(sb, sf);
if (elems == 0) {
return null;
} else if (elems > 1) {
sb.insert(0,"(&");
sb.append(")");
}
return FrameworkUtil.createFilter(sb.toString());
}
public PathResolver getPathResolver() {
if (pathResolver == null) {
// Get all Services implement PathResolver interface
try {
ServiceReference<?>[] references = this.context
.getAllServiceReferences(PathResolver.class.getName(),
null);
for (ServiceReference<?> ref : references) {
return (PathResolver) this.context.getService(ref);
}
return null;
}
catch (InvalidSyntaxException e) {
LOGGER.warning("Cannot load PathResolver on ReportJspMetadataListener.");
return null;
}
}
else {
return pathResolver;
}
}
public MvcOperations getMvcOperations() {
if (mvcOperations == null) {
// Get all Services implement MvcOperations interface
try {
ServiceReference<?>[] references = this.context
.getAllServiceReferences(MvcOperations.class.getName(),
null);
for (ServiceReference<?> ref : references) {
return (MvcOperations) this.context.getService(ref);
}
return null;
}
catch (InvalidSyntaxException e) {
LOGGER.warning("Cannot load MvcOperations on JQueryOperationsImpl.");
return null;
}
}
else {
return mvcOperations;
}
}
public ProjectOperations getProjectOperations() {
if (projectOperations == null) {
// Get all Services implement ProjectOperations interface
try {
ServiceReference[] references = context
.getAllServiceReferences(
ProjectOperations.class.getName(), null);
for (ServiceReference ref : references) {
projectOperations = (ProjectOperations) context
.getService(ref);
return projectOperations;
}
return null;
}
catch (InvalidSyntaxException e) {
LOGGER.warning("Cannot load ProjectOperations on DependencyListenerImpl.");
return null;
}
}
else {
return projectOperations;
}
}
public PathResolver getPathResolver() {
if (pathResolver == null) {
// Get all Services implement PathResolver interface
try {
ServiceReference<?>[] references = this.context
.getAllServiceReferences(PathResolver.class.getName(),
null);
for (ServiceReference<?> ref : references) {
return (PathResolver) this.context.getService(ref);
}
return null;
}
catch (InvalidSyntaxException e) {
LOGGER.warning("Cannot load PathResolver on BootstrapOperationsImpl.");
return null;
}
}
else {
return pathResolver;
}
}
public PullManager () throws InvalidSyntaxException
{
final String driver = DataSourceHelper.getDriver ( SPECIFIC_PREFIX, DataSourceHelper.DEFAULT_PREFIX );
this.tracker = new DataSourceFactoryTracker ( Activator.getContext (), driver, null );
if ( driver == null )
{
logger.error ( "JDBC driver is not set" );
throw new IllegalStateException ( "JDBC driver name is not set" );
}
this.tracker.open ();
this.thread = new Thread ( "org.eclipse.scada.ae.slave.pull.Worker" ) {
@Override
public void run ()
{
PullManager.this.run ();
}
};
this.thread.start ();
}
public PathResolver getPathResolver() {
if (pathResolver == null) {
// Get all Services implement PathResolver interface
try {
ServiceReference<?>[] references = this.context
.getAllServiceReferences(PathResolver.class.getName(),
null);
for (ServiceReference<?> ref : references) {
return (PathResolver) this.context.getService(ref);
}
return null;
}
catch (InvalidSyntaxException e) {
LOGGER.warning("Cannot load PathResolver on MonitoringOperationsImpl.");
return null;
}
}
else {
return pathResolver;
}
}
public FileManager getFileManager() {
if (fileManager == null) {
// Get all Services implement FileManager interface
try {
ServiceReference<?>[] references = this.context
.getAllServiceReferences(FileManager.class.getName(),
null);
for (ServiceReference<?> ref : references) {
return (FileManager) this.context.getService(ref);
}
return null;
}
catch (InvalidSyntaxException e) {
LOGGER.warning("Cannot load FileManager on JpaGeoOperationsImpl.");
return null;
}
}
else {
return fileManager;
}
}
public TypeLocationService getTypeLocationService() {
if (typeLocationService == null) {
// Get all Services implement TypeLocationService interface
try {
ServiceReference<?>[] references = this.context
.getAllServiceReferences(
TypeLocationService.class.getName(), null);
for (ServiceReference<?> ref : references) {
return (TypeLocationService) this.context.getService(ref);
}
return null;
}
catch (InvalidSyntaxException e) {
LOGGER.warning("Cannot load TypeLocationService on MonitoringOperationsImpl.");
return null;
}
}
else {
return typeLocationService;
}
}
public ProjectOperations getProjectOperations() {
if (projectOperations == null) {
// Get all Services implement ProjectOperations interface
try {
ServiceReference<?>[] references = this.context
.getAllServiceReferences(
ProjectOperations.class.getName(), null);
for (ServiceReference<?> ref : references) {
return (ProjectOperations) this.context.getService(ref);
}
return null;
}
catch (InvalidSyntaxException e) {
LOGGER.warning("Cannot load ProjectOperations on WSImportMetadataProvider.");
return null;
}
}
else {
return projectOperations;
}
}
public GeoOperations getGeoOperations() {
if (operations == null) {
// Get all Services implement GeoOperations interface
try {
ServiceReference[] references = context
.getAllServiceReferences(GeoOperations.class.getName(),
null);
for (ServiceReference ref : references) {
operations = (GeoOperations) context.getService(ref);
return operations;
}
return null;
}
catch (InvalidSyntaxException e) {
LOGGER.warning("Cannot load GeoOperations on DependencyListenerImpl.");
return null;
}
}
else {
return operations;
}
}
/**
* Constructs a condition that tries to match the passed Bundle's location
* to the location pattern.
*
* @param bundle The Bundle being evaluated.
* @param info The ConditionInfo from which to construct the condition. The
* ConditionInfo must specify one or two arguments. The first
* argument of the ConditionInfo specifies the location pattern
* against which to match the bundle location. Matching is done
* according to the filter string matching rules. Any '*' characters
* in the first argument are used as wildcards when matching bundle
* locations unless they are escaped with a '\' character. The
* Condition is satisfied if the bundle location matches the pattern.
* The second argument of the ConditionInfo is optional. If a second
* argument is present and equal to "!", then the satisfaction of the
* Condition is negated. That is, the Condition is satisfied if the
* bundle location does NOT match the pattern. If the second argument
* is present but does not equal "!", then the second argument is
* ignored.
* @return Condition object for the requested condition.
*/
static public Condition getCondition(final Bundle bundle, final ConditionInfo info) {
if (!CONDITION_TYPE.equals(info.getType()))
throw new IllegalArgumentException("ConditionInfo must be of type \"" + CONDITION_TYPE + "\"");
String[] args = info.getArgs();
if (args.length != 1 && args.length != 2)
throw new IllegalArgumentException("Illegal number of args: " + args.length);
String bundleLocation = AccessController.doPrivileged(new PrivilegedAction<String>() {
public String run() {
return bundle.getLocation();
}
});
Filter filter = null;
try {
filter = FrameworkUtil.createFilter("(location=" + escapeLocation(args[0]) + ")");
} catch (InvalidSyntaxException e) {
// this should never happen, but just in case
throw new RuntimeException("Invalid filter: " + e.getFilter(), e);
}
Dictionary<String, String> matchProps = new Hashtable<String, String>(2);
matchProps.put("location", bundleLocation);
boolean negate = (args.length == 2) ? "!".equals(args[1]) : false;
return (negate ^ filter.match(matchProps)) ? Condition.TRUE : Condition.FALSE;
}
@Override
public ScriptEngine getScriptEngineForLanguage(String language) {
ScriptEngine scriptEngine = null;
try {
scriptEngine = resolveScriptEngine(language);
} catch (InvalidSyntaxException e) {
throw new ProcessEngineException(
"problem resolving scripting engine" + e.getMessage(), e);
}
if (scriptEngine == null) {
throw new ProcessEngineException(
"Can't find scripting engine for '" + language + "'");
}
return scriptEngine;
}
void doQuery() throws InvalidSyntaxException {
if (tail.length() < 3 || !prefix("("))
error(MALFORMED);
switch (tail.charAt(0)) {
case '&':
doAnd();
break;
case '|':
doOr();
break;
case '!':
doNot();
break;
default:
doSimple();
break;
}
if (!prefix(")"))
error(MALFORMED);
}
public I18nSupport getI18nSupport() {
if (i18nSupport == null) {
// Get all Services implement I18nSupport interface
try {
ServiceReference<?>[] references = this.context
.getAllServiceReferences(I18nSupport.class.getName(),
null);
for (ServiceReference<?> ref : references) {
return (I18nSupport) this.context.getService(ref);
}
return null;
}
catch (InvalidSyntaxException e) {
LOGGER.warning("Cannot load I18nSupport on DatatablesOperationsImpl.");
return null;
}
}
else {
return i18nSupport;
}
}
public WebMetadataService getWebMetadataService() {
if (webMetadataService == null) {
// Get all Services implement WebMetadataService interface
try {
ServiceReference<?>[] references = this.context
.getAllServiceReferences(
WebMetadataService.class.getName(), null);
for (ServiceReference<?> ref : references) {
return (WebMetadataService) this.context.getService(ref);
}
return null;
}
catch (InvalidSyntaxException e) {
logger.warning("Cannot load WebMetadataService on ReportMetadataProvider.");
return null;
}
}
else {
return webMetadataService;
}
}
public WSConfigService getWSConfigService() {
if (wSConfigService == null) {
// Get all Services implement WSConfigService interface
try {
ServiceReference<?>[] references = this.context
.getAllServiceReferences(
WSConfigService.class.getName(), null);
for (ServiceReference<?> ref : references) {
return (WSConfigService) this.context.getService(ref);
}
return null;
}
catch (InvalidSyntaxException e) {
LOGGER.warning("Cannot load WSConfigService on WSExportMetadataProvider.");
return null;
}
}
else {
return wSConfigService;
}
}
private void updateDataSource () throws InvalidSyntaxException
{
logger.debug ( "updateDataSource ()" );
if ( this.dataSourceTracker != null )
{
this.dataSourceTracker.close ();
this.dataSourceTracker = null;
}
if ( this.dataSourceId != null )
{
logger.debug ( "track datasource {}", this.dataSourceId );
this.dataSourceTracker = new SingleDataSourceTracker ( this.poolTracker, this.dataSourceId, new ServiceListener () {
@Override
public void dataSourceChanged ( final DataSource dataSource )
{
setDataSource ( dataSource );
}
} );
this.dataSourceTracker.open ();
}
}
protected Filter createFilter ()
{
try
{
Class<?> filterClazz;
if ( this.clazz != null )
{
filterClazz = this.clazz;
}
else
{
filterClazz = ConnectionService.class;
}
return FilterUtil.createAndFilter ( filterClazz.getName (), createFilterParameters () );
}
catch ( final InvalidSyntaxException e )
{
logger.warn ( "Failed to create filter", e );
return null;
}
}
public ServiceReference[] getServiceReferences(String str, String str2) throws InvalidSyntaxException {
Collection collection;
checkValid();
Filter fromString = RFC1960Filter.fromString(str2);
if (str == null) {
collection = Framework.services;
} else {
List list = (List) Framework.classes_services.get(str);
if (list == null) {
return null;
}
}
List arrayList = new ArrayList();
ServiceReferenceImpl[] serviceReferenceImplArr = (ServiceReferenceImpl[]) collection.toArray(new ServiceReferenceImpl[collection.size()]);
for (int i = 0; i < serviceReferenceImplArr.length; i++) {
if (fromString.match(serviceReferenceImplArr[i])) {
arrayList.add(serviceReferenceImplArr[i]);
}
}
if (Framework.DEBUG_SERVICES && log.isInfoEnabled()) {
log.info("Framework: REQUESTED SERVICES " + str + " " + str2);
log.info("\tRETURNED " + arrayList);
}
return arrayList.size() == 0 ? null : (ServiceReference[]) arrayList.toArray(new ServiceReference[arrayList.size()]);
}
public WebMvcOperations getWebMvcOperations() {
if (webMvcOperations == null) {
// Get all Services implement WebMvcOperations interface
try {
ServiceReference<?>[] references = this.context
.getAllServiceReferences(
WebMvcOperations.class.getName(), null);
for (ServiceReference<?> ref : references) {
return (WebMvcOperations) this.context.getService(ref);
}
return null;
}
catch (InvalidSyntaxException e) {
LOGGER.warning("Cannot load WebMvcOperations on DatatablesOperationsImpl.");
return null;
}
}
else {
return webMvcOperations;
}
}
public WebProjectUtils getWebProjectUtils() {
if (webProjectUtils == null) {
// Get all Services implement WebProjectUtils interface
try {
ServiceReference<?>[] references = this.context
.getAllServiceReferences(
WebProjectUtils.class.getName(), null);
for (ServiceReference<?> ref : references) {
webProjectUtils = (WebProjectUtils) this.context
.getService(ref);
return webProjectUtils;
}
return null;
}
catch (InvalidSyntaxException e) {
LOGGER.warning("Cannot load WebProjectUtils on MenuEntryOperationsImpl.");
return null;
}
}
else {
return webProjectUtils;
}
}